Column Converter for Excel

版本 1.1.0.0 (2.2 KB) 作者: Kevin Crosby
Convert Excel column letters to numbers or vice versa, for processing data to/from XLSREAD/XLSWRITE.
4.8K 次下载
更新时间 2010/8/2

查看许可证

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.

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

See more examples in help comments.

Notes:
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.

Acknowledgment:
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 http://www.mathworks.com/matlabcentral/fileexchange/27182-excel-column-conversion

引用格式

Kevin Crosby (2024). Column Converter for Excel (https://www.mathworks.com/matlabcentral/fileexchange/28343-column-converter-for-excel), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2010a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Spreadsheets 的更多信息
致谢

启发作品: xlsrange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.1.0.0

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

1.0.0.0