Help with duplicates

demasijr6

New Member
Joined
Sep 20, 2022
Messages
12
Office Version
  1. 365
Platform
  1. Windows
Hello,

I need assistance with duplicates in Excel. I work with spreadsheets and tables. Currently I have a table that I know contains duplicates which is driving inaccurate numbers. I know how to find duplicates using conditional formatting BUT that doesn't solve my problem. I need to find how many instances of the identification number there are and remove the second or greater duplicate. In other words if identification number 22334455 has 3 instances in my table I want to keep the first and remove the second and third.

Would I still use conditional formatting to identify the duplicates? I thought I could use countifs, but I must be doing something wrong because it's not providing me the results I'm looking for.

I would really appreciate any help as soon as possible. I hope I'm asking my question correctly. Please let me know if any clarification is needed.
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Although some work, you can create a helper column with a formula. Assuming your ID's start at Cell A2.
The helper column formula would be
Label the helper column "Has >2 Duplicates"
Excel Formula:
=COUNTIF($A$2:A2,A2)>2
and copy down.

Then filter the entire data for that column being TRUE.
Then delete all those rows.

There is probably a way to do it systematically and repeatedly with Power Query, as well.
 
Upvote 1
Solution
Although some work, you can create a helper column with a formula. Assuming your ID's start at Cell A2.
The helper column formula would be
Label the helper column "Has >2 Duplicates"
Excel Formula:
=COUNTIF($A$2:A2,A2)>2
and copy down.

Then filter the entire data for that column being TRUE.
Then delete all those rows.

There is probably a way to do it systematically and repeatedly with Power Query, as well.
Thank you. I think this is what I needed. It seems to have worked. I will test it over the next few days. I really appreciate your time!
 
Upvote 0
happy to help.

Best wishes!
Thank you again, I have discovered I need the next part of my process. Now that I have identified all of the duplicates I need to keep the first instance and delete the rest. Is there a formula I can use for that?
 
Upvote 0
I figured it out. I changed the formula by saying >1 instead of >2. It marked all of the second instances with true and when I filtered I was able to delete them. Thank you very much @awoohaw
 
Upvote 0
I figured it out. I changed the formula by saying >1 instead of >2. It marked all of the second instances with true and when I filtered I was able to delete them. Thank you very much @awoohaw
You're welcome. Your original question was for greater than two, so that is why I had that.

Best Wishes!
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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