WeCodeAcademy

How To: Find and Remove Duplicates

Duplicate records inflate totals and spoil counts. The safe routine:

  1. Find them: =COUNTIF($A$2:$A$9,A2)>1 flags repeats.
  2. Check that they really are duplicates, not two people with the same name.
  3. Remove: Data > Remove Duplicates on a copy of the data, or build a clean list with UNIQUE.

Counting how many are extra, rows - distinct values, tells you how big the problem is.

Exampleexcel
Open in editor »
Quick check

Why copy the data before using Remove Duplicates?

Your turn: write the code

Mark each row in B2:B5 with =COUNTIF(A2:A5,A2) so repeated names show a number above 1.

Finish the quick check (and any code exercise) to complete this lesson, or mark it done yourself.

Tip: use the left and right arrow keys to move between lessons.