Number to Letter Counting algorithim needed
- From: "Gary H" <nospam@xxxxxxxxx>
- Date: Sat, 16 Jun 2007 20:38:59 +0100
Hi,
not sure if this best place to ask but hoping ill get answer to a bugging
algorithim im trying to work out.
Basically im trying to convert numbers into a character sequence as such
that A = 1 to Z = 26, but when you get to 27 it becomes AA all the way to
702 which is ZZ then 703 is AAA
ie...
AAA
AAB
AAC
.....
ABA
ABB
ABC
Now what ive been doing so far is this....(works 90% time)
ie take number 12131 which stands for QXO
ill divind 12131 by 26^2 or 676 which gives 17 MOD 639
then ill divind 639 by 26^1 or 26 which gives 24 MOD 15
taking the 17, 24 and 15 in order give the character value of QXO
another example
ie take number 1406 which stands for BBB
ill divind 1406 by 26^2 or 676 which gives 2 MOD 54
then ill divind 54 by 26^1 or 26 which gives 2 MOD 2
taking the 2, 2 and 2 in order give the character value of BBB
My problem comes with say 16224 - WYZ
ill divind 16224 by 26^2 or 676 which gives 24 MOD 0
????
which is now already wrong as 24 is X now W. im now stuck in what to do lol
If your curious im tring to work out how to convert Excel 2007 column
numbers to there letter equilivant.
Any help be very much appreciated.
Many Thanks
Gary
.
- Follow-Ups:
- Re: Number to Letter Counting algorithim needed
- From: Wlodzimierz Holsztynski (wlod)
- Re: Number to Letter Counting algorithim needed
- From: Wlodzimierz Holsztynski (wlod)
- Re: Number to Letter Counting algorithim needed
- From: dazmax
- Re: Number to Letter Counting algorithim needed
- From: drmwecker
- Re: Number to Letter Counting algorithim needed
- Prev by Date: Re: Ideals
- Next by Date: Re: Ideals
- Previous by thread: HELP! Give me an example please...
- Next by thread: Re: Number to Letter Counting algorithim needed
- Index(es):
Relevant Pages
|