File Exchange

image thumbnail

Excel Column Conversion

version 1.1 (1.93 KB) by

Converts between column name and number for Excel representation



View License

Editor's Note: This file was selected as MATLAB Central Pick of the Week

ExcelCol Converts between column name and number for Excel representation
Out=ExcelCol(In) takes the input In, which may be a number, vector, char, or cell and converts it to the other representation

If IN is numeric, output will be a column cell of the column name
If IN is char or cell, output will be a number or column vector, ignoring any numberic part which may be included in input

ExcelCol(100) %Number to column name
ExcelCol('CV') %Column name to number
ExcelCol([1 10 100 1000 16383]) %Multiple conversions
ExcelCol({'A' 'J' 'CV' 'ALL' 'XFC'}) %Multiple conversions

Comments and Ratings (5)


Oscar (view profile)

Awwww yeah, thank you very much! Nice work.


Image Analyst

Image Analyst (view profile)

Thanks. Works great. Just what I needed. I just had one Excel cell reference and the results came back as a MATLAB cell when what I needed was a string (character array), but I just passed the cell returned from ExcelCol into cell2mat() and I got my string like I needed.


Petter (view profile)

A range of numbers should return an Excel range as well.



Rewrote help and summary

MATLAB Release
MATLAB 7.14 (R2012a)

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

» Watch video

Win prizes and improve your MATLAB skills

Play today