# sequencing letters

#### mattyb

##### New Member
I need to create a sequence of letters to be used in an alpha based identification code. I want the user to key in one code (ie PREAAAA ) where the frist four characters are constant and the last three build in sequential order. Example would be
1-PREAAAA
2-PREAAAB
3-PREAAAC
.....
n-PREAABA
.....
n-PREAACA
.....
Any thoughts on a formula that can do this?
Mattyb

### Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

#### schielrn

##### Well-known Member
I have this, but it does not work for anything ending in Z after the first one and unfortunately I do not have the time at the moment to look in depth into this:

Hope that helps.

#### texasalynn

##### Well-known Member
try putting this into a cell
="PREAA"&char(row(a65))

then when you copy down it will sequence from A to Z

#### schielrn

##### Well-known Member
Actually I looked at it a little more and noticed a flaw with one thing and fixed that but still have the problem with it ending in Z because of how mod behaves, but could probably insert an if statement to fix that:

#### pgc01

##### MrExcel MVP
Hi

Another option. In A2:

="PREA"&CHAR(CODE("A")+INT((ROWS(\$A\$2:A2)-1)/676))&CHAR(CODE("A")+MOD(INT((ROWS(\$A\$2:A2)-1)/26),26))&CHAR(CODE("A")+MOD(ROWS(\$A\$2:A2)-1,26))

Copy down

#### mattyb

##### New Member
All the assistance is much appreciated.

#### nbrcrunch

##### Well-known Member
if you're willing to entertain hex numbers:

=LEFT("000",LEN("000")-LEN(TEXT(DEC2HEX(ROW()),"000")))&(TEXT(DEC2HEX(ROW()),"000"))

Replies
16
Views
2K
Replies
10
Views
3K
Replies
1
Views
469
Replies
1
Views
667
Replies
0
Views
2K

1,191,077
Messages
5,984,503
Members
439,894
Latest member
Amba1006

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back