Forum Discussion
How do I remove rows with duplicate values?
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
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 AmairahJan 14, 2019Silver 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 https://support.office.com/en-us/article/COUNTIF-function-E0DE10C6-F885-4E71-ABB4-1F464816DF34.
Hope that makes sense.
- Jason32Jan 14, 2019Copper Contributor
Can you tell me what I'm doing wrong? See attached please.
- Haytham AmairahJan 14, 2019Silver Contributor
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.