Sequential Numbering Based on Data in Cells

jharbold

New Member
Joined
Feb 17, 2018
Messages
12
Hello,

I am attempting to do the following and would appreciate any help:

I have a spreadsheet that looks like the following
[TABLE="width: 500"]
<tbody>[TR]
[TD]ABC[/TD]
[TD]ABC-001[/TD]
[/TR]
[TR]
[TD]DEF[/TD]
[TD]DEF-001[/TD]
[/TR]
[TR]
[TD]ABC[/TD]
[TD]ABC-002[/TD]
[/TR]
[TR]
[TD]ABC[/TD]
[TD]ABC-003[/TD]
[/TR]
[TR]
[TD]DEF[/TD]
[TD]DEF-002[/TD]
[/TR]
</tbody>[/TABLE]

I manually enter in the information in the first column. In the second column, I need to create an equation that will automatically pull over the data in the first column, add a "-", and then create sequential numbering based on the values in column A. For example, in the third row, I need the equation to know that "ABC" is entered in the first column, so it needs to search above in the second column to see what the last "ABC" value was (in this case ABC-001), and then return "ABC-002" (001+1).

To make matters a bit more complicated, the values in the first column may not always be 3 characters as shown here, but the numbers and the letters in the second column will always be separated by a "-".

I appreciate the help!
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
How about
=A2&"-"&TEXT(COUNTIF(A$2:A2,A2),"000")
and copied down
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,915
Members
452,366
Latest member
TePunaBloke

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