Created
July 11, 2013 12:08
-
-
Save arjan/5974897 to your computer and use it in GitHub Desktop.
Given 0-based column number return the Excel column name.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% Given 0-based column number return the Excel column name as list. | |
column(N) -> | |
column(N, []). | |
column(N, Acc) when N < 26 -> | |
[(N)+$A | Acc]; | |
column(N, Acc) -> | |
column(N div 26-1, [(N rem 26)+$A|Acc]). | |
Author
arjan
commented
Jul 11, 2013
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment