Sequential Numbering

coloradoprincess78

New Member
Joined
Oct 31, 2016
Messages
14
Hello Magical Excel Guru's!

I am trying to determine if there is a way that I can use either a formula or vba to auto assign sequential numbering based on text.
Basically we have the united states split into 5 zones. There are multiple states in each zone. Each customer will be assign a site number that combines a pre-fix, zone number, state abbreviation and a 4 digit number. Each state can have up to 9999 numbers.

I would like to house this data in one worksheet, rather than 52 (for each state) and have the number portion automatically assign the next sequential digit available for that particular state.
Good grief, I hope that makes sense.

Here is my example below. The columns in red are formula driven to pull data from another worksheet. I am looking for a formula in the last column that can auto assign a number.
My boss wants me to start each number at 0100 for each state. Column A is a concatenate formula from E,F,G and H. (E is hidden because it is a static text for the moment)



Excel 2010
ABCDFGH
CON2-AZ0100ABCPhoenixArizona
CON3-NE0100XYZOmahaNebraska
CON3-NE0101JKLWrightsvilleNebraska
CON2-AZ0117EFGPeoriaArizona

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="bgcolor: #FFE699"]Site[/TD]
[TD="bgcolor: #A9D08E"]Customer[/TD]
[TD="bgcolor: #A9D08E"]City[/TD]
[TD="bgcolor: #A9D08E"]State[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FF0000]#FF0000[/URL] , align: center"]Zone[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FF0000]#FF0000[/URL] , align: center"]State Abbreviation[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FF0000]#FF0000[/URL] , align: center"]Number[/TD]

[TD="align: center"]2[/TD]

[TD="align: center"]2[/TD]
[TD="align: center"]AZ[/TD]
[TD="align: center"]0100[/TD]

[TD="align: center"]3[/TD]

[TD="align: center"]3[/TD]
[TD="align: center"]NE[/TD]
[TD="align: center"]0100[/TD]

[TD="align: center"]4[/TD]

[TD="align: center"]3[/TD]
[TD="align: center"]NE[/TD]
[TD="align: center"]0101[/TD]

[TD="align: center"]5[/TD]

[TD="align: center"]2[/TD]
[TD="align: center"]AZ[/TD]
[TD="align: center"]0117[/TD]

</tbody>
Zone 1 (2)



Sorry if this is confusing! Thank you in advance for your help!
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Try, this should start at 100 and then add one each time the state is the same.
Code:
=COUNTIF($G$2:G2,G2)+99
 
Upvote 0
Thank you so much Scott!
Worked perfectly! - I haven't needed to use the countif function in the past, but perhaps should have spent a little more time on this before asking for help. :eeek:

I sincerely appreciate your time :)
 
Upvote 0

Forum statistics

Threads
1,224,822
Messages
6,181,165
Members
453,021
Latest member
Justyna P

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top