Generate excel column name from index This one comes from a real life problem. We solved it, of course, but it keeps feeling like it could have be done better, that it's too lengthy and roundabout solution. However none of my colleagues can think of a more succinct way of writing it. Hence I present it as code-golf.

The goal is to convert a nonnegative integer into a string the same way Excel presents its column headers. Thus:

0 -&gt; A
1 -&gt; B
...
25 -&gt; Z
26 -&gt; AA
27 -&gt; AB
...
51 -&gt; AZ
52 -&gt; BA
...
16,383 -&gt; XFD


It has to work at least up to 16,383, but beyond is acceptable too (no bonus points though). I'm looking forward most to the C# solution, but, as per traditions of code-golf, any real programming language is welcome.
Excel Formula:), 36 chars

=SUBSTITUTE(ADDRESS(1,A1,4),"1","")


Usage:



Sorry, couldn't resist ...