Adding Sequential Numbering to a Non-Sequential List

Astayonix

New Member
Joined
Aug 5, 2014
Messages
3
I'm a bit stumped by this one. I'm trying to make a formula that will add sequential numbering to a non-sequential list. Here is an example of what I'm talking about.

[TABLE="width: 393"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD]Category
[/TD]
[TD]Category with Sequential Numbering
[/TD]
[TD]Match Result[/TD]
[/TR]
[TR]
[TD]D
[/TD]
[TD]D01[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]A01[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]A02[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]C01[/TD]
[TD="align: right"]7[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]B01[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]B02[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]B03[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]A03[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]A04[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]C02[/TD]
[TD="align: right"]7[/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]C03[/TD]
[TD="align: right"]7[/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]C04[/TD]
[TD="align: right"]7[/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]C05[/TD]
[TD="align: right"]7[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]A05[/TD]
[TD="align: right"]5[/TD]
[/TR]
</tbody>[/TABLE]

I've tried using the match function, and it groups the "like" categories (A's, B's, C's, and D's), but I'm unsure how to add the incremental numbering. I also need the first instance of every new category to start with 01 (A01, B01, C01, and D01) before the formula walks down the list and adds the next numerical increment to the next instance of that category's appearance. Any help and/or ideas rendered would be GREATLY appreciated!

-=Astayonix=-
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Just a thought assuming the letters are in column A

=A2&TEXT(COUNTIF($A$2:A2,A2),"00")
 
Upvote 0
Just a thought assuming the letters are in column A

=A2&TEXT(COUNTIF($A$2:A2,A2),"00")

Hi, Weazel! :)

Thank you for the response! I tried the COUNTIF, and while it was able to count the number of instances of each of the categories (per below), it doesn't anchor the first instance of each (A01, B01, C01, and D01), and it doesn't add the incremental numbering to each sequence (A01, A02, A03, A04, A05, etc.). The MATCH function is able to properly segregate the categories (A's, B's, C's, and D's), and the COUNT-IF returns the number of times that each category occurs in the list, but the sequential numbering is probably some type of hybrid use of both (??). This one is kind of sticky! Thank you very much for the input!

[TABLE="width: 457"]
<colgroup><col><col><col><col></colgroup><tbody>[TR]
[TD]Category[/TD]
[TD]Category with Sequential Numbering[/TD]
[TD]Match Result[/TD]
[TD]Count-If Result[/TD]
[/TR]
[TR]
[TD]D[/TD]
[TD]D01[/TD]
[TD="align: right"]4[/TD]
[TD]D01[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]A01[/TD]
[TD="align: right"]5[/TD]
[TD]A05[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]A02[/TD]
[TD="align: right"]5[/TD]
[TD]A05[/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]C01[/TD]
[TD="align: right"]7[/TD]
[TD]C05[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]B01[/TD]
[TD="align: right"]8[/TD]
[TD]B03[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]B02[/TD]
[TD="align: right"]8[/TD]
[TD]B03[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]B03[/TD]
[TD="align: right"]8[/TD]
[TD]B03[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]A03[/TD]
[TD="align: right"]5[/TD]
[TD]A05[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]A04[/TD]
[TD="align: right"]5[/TD]
[TD]A05[/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]C02[/TD]
[TD="align: right"]7[/TD]
[TD]C05[/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]C03[/TD]
[TD="align: right"]7[/TD]
[TD]C05[/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]C04[/TD]
[TD="align: right"]7[/TD]
[TD]C05[/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]C05[/TD]
[TD="align: right"]7[/TD]
[TD]C05[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]A05[/TD]
[TD="align: right"]5[/TD]
[TD]A05[/TD]
[/TR]
</tbody>[/TABLE]

-=Astayonix =-
 
Upvote 0
Hi, Weazel! :)

Thank you for the response! I tried the COUNTIF, and while it was able to count the number of instances of each of the categories (per below), it doesn't anchor the first instance of each (A01, B01, C01, and D01), and it doesn't add the incremental numbering to each sequence (A01, A02, A03, A04, A05, etc.).
Did you use the EXACT formula Weazel posted or did you attempt to modify it? His formula, exactly as posted, does exactly what you are describing you want for me when I test it against the data you posted.
 
Upvote 0
Did you use the EXACT formula Weazel posted or did you attempt to modify it? His formula, exactly as posted, does exactly what you are describing you want for me when I test it against the data you posted.

Hi, Rick!

You are correct! I had modified it a bit to include a specific range on the COUNTIF! It DOES work properly! It both anchors the 01 entry for each category and it sequentially numbers each addition to the category! This is AMAZING! Thank you both so much! I truly appreciate it!

-= Astayonix =-
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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