Create unique ID based off of adjacent cell

kod2th3e

Board Regular
Joined
Apr 2, 2008
Messages
87
I am trying to use a forumla to look at the value in column b then create a unique id in column a based off of that value. In the table below I have a 3 digit value (in column B) that may be repeated any given number of times and if so I want the corresponding text in column "A" to equal that value with a "-1", "-2", etc after it depending how how many times the number has been repeated. Thanks in advance for any/all help.

[TABLE="class: grid, width: 150"]
<tbody>[TR]
[TD]Col A
[/TD]
[TD]Col B
[/TD]
[/TR]
[TR]
[TD]114-1
[/TD]
[TD]114
[/TD]
[/TR]
[TR]
[TD]114-2
[/TD]
[TD]114
[/TD]
[/TR]
[TR]
[TD]114-3
[/TD]
[TD]114
[/TD]
[/TR]
[TR]
[TD]114-4
[/TD]
[TD]114
[/TD]
[/TR]
[TR]
[TD]115-1
[/TD]
[TD]115
[/TD]
[/TR]
[TR]
[TD]115-2
[/TD]
[TD]115
[/TD]
[/TR]
[TR]
[TD]116-1
[/TD]
[TD]116
[/TD]
[/TR]
[TR]
[TD]116-2
[/TD]
[TD]116
[/TD]
[/TR]
[TR]
[TD]116-3
[/TD]
[TD]116
[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Assuming your data begins in row 1, place this formula in cell A1 and copy down:
Code:
=B1 & "-" & COUNTIF(B$1:B1,B1)
 
Upvote 0

Forum statistics

Threads
1,223,923
Messages
6,175,401
Members
452,640
Latest member
steveridge

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