How can I add a single character to a duplicate cell in Excel

laundon

New Member
Joined
Jan 5, 2005
Messages
18
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
Hi,

I have used this forum many times over the years for help and hope this time, you can help again!

To explain, I have a spreadsheet of part numbers or product codes. Each part number originally had a prefix, say, AA-1234. I had the need to remove the "AA-" part. This then gives me a column with a part number without a prefix, however I may now have duplicates as AA-1234 and BB-1234 will both now be 1234.

What I am trying to do is on the duplicate line only, add a suffix character to make it unique again and I can't work out how to do it!

So to continue my example from above, the duplicate line only would then become 1234D for example making it now unique, so I would have 1234, and 1234D

Any ideas from you fabulous bunch of people?

Many Thanks, and Festive Greetings to you all!

Tim.
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
1) Is the column A in sequence ?
2) "Diur tricB" to become "Diur tric1":
why not "Diur tricB"?
edit: ignore it. I had posted before the correction in 11 seen.
 
Upvote 0
Upvote 0
From your image it appears that the Input data is sorted. If that is so, then this should suffice.

22 05 17.xlsm
AB
1InputOutput
2Cymb canaCymb cana
3Cymb canaCymb cana1
4Cymb canaCymb cana2
5Diur tricDiur tric
6Diur tricDiur tric1
7Geno plumGeno plum
8Geno rhyoGeno rhyo
9Geno supeGeno supe
Add count
Cell Formulas
RangeFormula
B2:B9B2=A2&IF(A2=A1,COUNTIF(A$1:A1,A2),"")

Book1
AB
1
2Cymb canaCymb cana
3Cymb canaCymb cana1
4Cymb canaCymb cana2
5Diur tricDiur tric
6Diur tricDiur tric1
7Geno plumnGeno plumn
8Geno plumnGeno plumn1
Sheet1
Cell Formulas
RangeFormula
B2:B8B2=A2&IF(COUNTIF($A$1:A2,A2)=1,"",COUNTIF($A$1:A2,A2)-1)
I just solved my problem with your solution to this question... I hope you are still around and that this message gets to you... just wanted to say Thank you!!! Truly appreciate your taking the time to answer questions that will help not only the person that asks but many more that will come in the future to learn from you.

Thank you!
 
Upvote 0
I just solved my problem with your solution to this question... I hope you are still around and that this message gets to you... just wanted to say Thank you!!! Truly appreciate your taking the time to answer questions that will help not only the person that asks but many more that will come in the future to learn from you.

Thank you!
You are welcome. Glad you found the thread useful. Thanks for your comments. :)

BTW, if you might ask questions in the future, I suggest that you update your forum profile (click your user name at the top right of the forum, then ‘Account details’) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
You are welcome. Glad you found the thread useful. Thanks for your comments. :)

BTW, if you might ask questions in the future, I suggest that you update your forum profile (click your user name at the top right of the forum, then ‘Account details’) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
Done :)
 
Upvote 0

Forum statistics

Threads
1,223,936
Messages
6,175,508
Members
452,650
Latest member
Tinfish

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