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
1SiteCustomerCityStateZoneState AbbreviationNumber
2CON2-AZ0100ABCPhoenixArizona2AZ0100
3CON3-NE0100XYZOmahaNebraska3NE0100
4CON3-NE0101JKLWrightsvilleNebraska3NE0101
5CON2-AZ0117EFGPeoriaArizona2AZ0117

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Zone 1 (2)



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

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
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. :eek:

I sincerely appreciate your time :)
 
Upvote 0

Forum statistics

Threads
1,214,991
Messages
6,122,628
Members
449,095
Latest member
bsb1122

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