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

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
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,920
Messages
6,122,264
Members
449,075
Latest member
staticfluids

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