View Single Post
  #12   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.vb.general.discussion
argusy argusy is offline
external usenet poster
 
Posts: 1
Default Excel columns: Converting numbers to letters and vice versa

Jack wrote:
It does make sense, just again I've made a mistake.
In Excel 2007 the maximum column index is: XFD
There are not 4 letters long column's indexes.

I know how to do it now..
Jack

<snip

Nice of you to tell the rest how you got there, but that's no mystery

I take it you finally, at last, worked out that there's 26 letters in
the alphabet, and you did some homework on powers and bases, and learnt
there's other counting systems than the decimal system

like binary, and octal, and hexadecimal, and ...

So 'A- Z' is 1 to 26

'AA' is 27, 'AB' is 28.... (like 26 + 1, 26 + 2)
The base is 26 ....
so each letter to the left is a power of 26

so 'ABC' is
26 * 26, (26^2 * 1 ('A')),
plus 26 * 2, (26^1 * 2 ('B')),
plus 1 * 3, (26^0 * 3 ('C'))

and 'XFD' then is 16384
or 2^14
or Hexadecimal 4000 - nice round number, innit?
strange that - 'XFD' being the last column .....

I think most of us in this newsgroup would know the above, but took you
a while to see it, didn't it