How do I remove rows with duplicate values?

Copper Contributor

I have a large Excel file that I combined from 2 different reports.  Column A is "User ID".  I want to remove the rows where User ID match.  I can't use the Remove Duplicates option because only one of the rows would be removed.  I want BOTH rows removed so I am left with only the User IDs that were NOT on both reports.

6 Replies

Hi,

 

Please take a look at the screenshot below.

 

Remove both duplicate rows.png 

Is that what you asking for?

If so, you can use COUNTIF function in a helper column to return the number of occurrences for each ID, then sort it from smallest to largest, and then delete the rows that are greater than one.

 

You can also use Power Query to do so.

 

Please find the attached file.

 

Hope that helps

Yes, that is what I am asking for, thank you.  Unfortunately, I don't know how to use the COUNTIF function or perform a Power Query.  Do you have a job aid or instructions I could follow?

Hi,

 

I would recommend you to use COUNTIF as the Power Query need multiple steps that are difficult to explain here.

 

This is the COUNTIF formula:

=COUNTIF($A$2:$A$7,A2)

COUNTIF.png

 

After you enter this formula in a new column as the screenshot above, you have to sort the column from smallest to largest, and then delete the entire rows that are greater than one.

 

To learn more about COUNTIF, please check out this link.

 

Hope that makes sense.

Can you tell me what I'm doing wrong?  See attached please.

This formula is correct!

But you need to put it in cell B2 and drag it down.

Then sort the column and delete the dups rows.

 

The dups starts from row 2891, just select them all and press delete.

COUNTIF2.png

Thank you!  You have been really helpful!