LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 229
Default how do I increment letters of the alphabet for a database


Use this formula in A1, B1, C1, D1:

=CHAR(CODE("A")+MOD(INT((ROW()-1)/(POWER(26,5-COLUMN()))),26))

Use this formula in E1:

=CHAR(CODE("A")+MOD(ROW()-1,26))

Copy down as many times as needed.

In F1, you could use this formula:

=A1&B1&C1&D1&E1

Then, copy down to create a column with the 5-letter combinations in
ascending order.

Just for kicks, I entered these formulae in Excel 2007 in each
available row. The last one - 1,048,576 - has the value of CHRDV.
If you want to take it from there, replace ROW()-1 with ROW()
+1,048,575 in each formula above. This calculation took about 15
minutes.

By comparison, running a similar expression on nearly 700,000 rows in
Access took only a few seconds. I used a combination of ROUND() and
ABS() to achieve the same result as MOD. You might consider that path
rather than messing with Excel.

On Aug 29, 9:24 pm, gretchen
wrote:
Howdy,

I use a database that contains an id field that is a 5 letter "code". So
the first item in the database is AAAAA, the second is AAAAB, the third is
AAAAC and so on until item 26 is AAAAZ. Item 27 is AAABA, then 28 is AAABB,
then 29 AAABC and on and on.

Is there a way for excel to increment all the letters up to ZZZZZ in
seperate cells?

Thanks!



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Solver - Assign values to the letters of the alphabet [email protected] Excel Discussion (Misc queries) 2 December 15th 06 11:18 AM
Solver - Assign values to Letters of the Alphabet GeoJack Excel Discussion (Misc queries) 0 December 14th 06 06:34 AM
Solver - Assign values to Letters of the Alphabet GeoJack Excel Discussion (Misc queries) 0 December 14th 06 06:25 AM
associate alphabet letters with numbers? Loriandme69 New Users to Excel 4 November 22nd 05 01:59 AM
how to assign a value to the alphabet in order to add up letters Robert Horne Excel Discussion (Misc queries) 1 December 10th 04 08:15 PM


All times are GMT +1. The time now is 12:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"