Rename Duplicates

jimmytiler

New Member
Joined
Aug 16, 2020
Messages
5
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
  2. MacOS
I have a list of town names for each state. However, some states have duplicate towns with different post-codes. Is it possible to search for duplicates then have them renamed in order: e.g. AliceSprings (1), AliceSprings (2), AliceSprings (3) ..... and so on? *I will need the numbers in parenthesis at the end due to an autocompletion set up for "SUBURB" in another cell.
 

Attachments

  • EXCELL001.JPG
    EXCELL001.JPG
    47.6 KB · Views: 8

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Try a formula similar to this, where Column H contains the Suburbs (Assuming your data is in a table):
Excel Formula:
=IF(COUNTIF([Suburb],[@Suburb])>1,[@Suburb]&" (" & COUNTIF($H$2:H2,[@Suburb]) & ")",[@Suburb])
 
Upvote 0
Solution
Here's the formula if you'd only like the cell references instead of the table field names:
Excel Formula:
=IF(COUNTIF($H:$H,H2)>1,H2&" (" & COUNTIF($H$2:H2,H2) & ")",H2)
 
Upvote 0
WOW! That worked. Thank you so much Max1616. I must admit though, I don't understand how it works (but so glad it does)
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,750
Members
448,989
Latest member
mariah3

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