View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Column Converter for Excel

5.0 | 2 ratings Rate this file 39 Downloads (last 30 days) File Size: 2.25 KB File ID: #28343 Version: 1.1

Column Converter for Excel


Kevin Crosby (view profile)


30 Jul 2010 (Updated )

Convert Excel column letters to numbers or vice versa, for processing data to/from XLSREAD/XLSWRITE.

| Watch this File

File Information

B = XLSCOL(A) takes input A, and converts to corresponding output B. The input may be a number, a string, an array or matrix, an Excel range, a cell, or a combination of each within a cell, including nested cells and arrays.

The output maintains the shape of the input and attempts to "flatten" the cell to remove nesting.

Numbers and symbols within strings or Excel ranges are ignored.

  xlscol(256) % returns 'IV'
  xlscol('IV') % returns 256
  xlscol('A1:IV65536') % returns [1 256]

See more examples in help comments.
  CELLFUN and ARRAYFUN allow the program to recursively handle multiple inputs. An interesting side effect is that mixed input, nested cells, and matrix shapes can be processed.

  I adapted the modular math from Mike Sheppard's program ExcelCol, to properly handle the conversion from column number to strings. His program is at


Excel Column Conversion inspired this file.

This file inspired Xlsrange.

MATLAB release MATLAB 7.10 (R2010a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (2)
01 Dec 2016 Florian Aendekerk

Love it!

22 Apr 2013 Richard Crozier

Nice, thanks.

02 Aug 2010 1.1

Vectorized loop under ISNUMERIC, and added right parenthesis to incorrect example.

Contact us