Forum Discussion

Jason32's avatar
Jason32
Copper Contributor
Jan 14, 2019

How do I remove rows with duplicate values?

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.

  • Haytham Amairah's avatar
    Haytham Amairah
    Silver Contributor

    Hi,

     

    Please take a look at the screenshot below.

     

     

    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

    • Jason32's avatar
      Jason32
      Copper Contributor

      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?

      • Haytham Amairah's avatar
        Haytham Amairah
        Silver Contributor

        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)

         

        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.

Resources