Remove Duplicates is one of the fastest commands in Excel: click a cell, go to Data → Remove Duplicates, tick some columns, click OK. Four seconds.

The trouble is that the same four seconds can produce two different answers on the same file, and the dialog never warns you when the answer is wrong. It reports "0 duplicates found" over a list that visibly contains repeats, or it quietly deletes the booking you needed because you ticked only one column.

This tutorial works through a small customer list, traps included. By the end you will know what Excel actually compares when it decides two rows are duplicates, how to preview the matches before anything is deleted, and how to fix the near-misses — a stray space, a number stored as text — that make real duplicates look different.

You need Excel for Microsoft 365, Excel 2021/2024, or Excel for the web; everything here is in the ribbon. If you are shaky on what a cell contains versus what it shows, read the earlier article on cells, formulas and references first.

What Excel means by a duplicate

Three rules decide every result. All three are in Microsoft's documentation, and none of them is visible in the dialog itself.

A duplicate is a row that matches another row in every column you tick. Tick all columns and only rows that agree everywhere count as duplicates. Tick one column — Email, say — and two rows with the same email count as duplicates even when the names differ.

The whole row goes with it. Microsoft states that data is removed from all columns, even the ones you did not tick. So ticking Email does not "deduplicate the email column"; it deletes whole records based on the email. This is the most common way people lose rows they needed.

Excel compares what the cells display, not what is stored. Microsoft's own example: the same date formatted as 3/8/2006 in one cell and Mar 8, 2006 in another counts as two unique values, because the text on screen differs. The same thing happens with a trailing space, where "Delhi" and "Delhi " are two different values, or with a text-formatted ID, where 00412 and 412 are two different values. Excel is not being inconsistent; it is comparing text, and those texts differ.

It keeps the first one. The first occurrence in the list survives; later copies are deleted. So row order is a decision you make, not an accident.

Microsoft's documentation does not say whether letter case affects the comparison, and reports differ. Don't build a result on that guess: if case matters for your data, decide the rule yourself with an UPPER helper column.

Step 1: Type in the example list, then copy it

Enter this starting at A1. Row 4 is an exact copy of row 3; the last two rows are Eve twice, with a space stuck on the end of one address.

ABC
1NameEmailClass
2Ada Chenada@example.comPottery
3Ben Choben@example.comPottery
4Carla Diazcarla@example.comYoga
5Ben Choben@example.comPottery
6Ben Choben@example.comPainting
7Dan Kimdan@example.comPottery
8Eve Parkeve@example.com␣Painting
9Eve Parkeve@example.comPainting

For row 8, type the email then hit the space bar once before pressing Enter. That invisible space is the whole point.

Now copy the block: select A1:C9, press Ctrl+C, click A12, press Ctrl+V. Work only on the copy — Remove Duplicates deletes permanently, and Ctrl+Z only rescues you if you have not saved yet.

Step 2: Decide which columns define one record

Click any single cell in the list and open Data → Remove Duplicates (keyboard: Alt, A, M). The dialog lists your columns with every box ticked, and My data has headers ticked, which keeps row 1 out of the comparison.

Ask what "one record" means here. For a mailing list it is one row per email address, so Email alone is the key. For a booking log, two rows with the same name and email but different classes are two bookings, and only a full-row match should be removed. A column that is unique on every row — a timestamp, a row ID — guarantees "0 duplicates found" if you leave it ticked.

Remove Duplicates dialog with My data has headers checked and only the Email column ticked

For this first run, leave all three columns ticked and click OK.

Step 3: Preview the matches before deleting anything

You should get the message 1 duplicate value found and removed; 7 unique values remain. Row 5 is gone; everything else survived, including both Eve rows and Ben's Painting booking.

Click OK, then press Ctrl+Z to bring the list back. Deleting is fast; deciding which rows should go is slow, so keep the two apart.

Two ways to see the matches first:

Conditional formatting, for one column. Select B1:B9, then Home → Conditional Formatting → Highlight Cells Rules → Duplicate Values, and pick a fill colour. The three ben@example.com cells light up; the two Eve rows do not, because the space makes their text different. That silent gap is the pattern to watch: the highlight compares cells one at a time inside a column, so it previews repeated values, not duplicate rows.

A helper column, for whole rows. In D1 type Row check, and in D2:

1=COUNTIFS($A$2:$A$9,A2,$B$2:$B$9,B2,$C$2:$C$9,C2)

Fill it down to D9 — dragging the corner of D2 copies the formula and shifts its relative references, while the $ locks the comparison ranges. You should see 2 in D3 and D5 and 1 everywhere else. Any count above 1 marks a row Remove Duplicates would delete, and the row that survives is the earlier one.

If column D says 1 everywhere, the list holds near-duplicates rather than duplicates — which is the next step. Delete the helper column before you carry on, so it does not join the comparison.

Excel table with a COUNTIFS helper column showing 1 and 2 for each row's repeat count

Step 4: Fix the near-misses that hide real duplicates

Tick only Email and run the command. You should see 2 duplicate values found and removed; 6 unique values remain — the exact-copy Ben row and the Painting Ben row, because both share Ben's email. Eve still appears twice, because of the space.

Undo both runs, then fix the space. In E1 type Clean email and in E2:

1=TRIM(B2)

Fill down to E9. E8 now reads identically to E9. TRIM removes extra spaces except the single ones between words — but it only trims the ordinary space character, so a space pasted in from a web page or PDF may survive, because those are non-breaking spaces (character 160). If TRIM leaves a suspicious cell unchanged, use:

1=TRIM(SUBSTITUTE(B2,CHAR(160)," "))

Put the cleaned text back where the original lived, since Remove Duplicates compares cells in place and a formula beside the data cleans nothing: copy E2:E9, click B2, then Paste Special → Values. Delete the helper column.

Two more near-misses behave the same way. Numbers stored as text are different values from numbers (00412 versus 412); convert with Data → Text to Columns → Finish. And the same date shown in two formats is two values, so apply one number format to the whole column before comparing.

Run the command again with Email ticked. This time: 3 duplicate values found and removed; 5 unique values remain. Ada, one Ben, Carla, Dan and one Eve survive. The count changed because the space did.

Step 5: Sort so the row you keep is the right one

Because the first occurrence survives, the row you want must come first. Ben's Painting booking is a real record that disappears the moment you dedupe on Email, so decide deliberately: sort by a "last updated" date, newest first, so the row worth keeping sits on top. Select the entire list before sorting, so the rows stay together.

Step 6: Check the numbers against your preview

The dialog's "duplicates removed" should equal the number of helper-column rows that showed a count above 1, and "unique values remain" should equal your remaining row count. In the whole-row run that was one row with a 2 and one row removed. If the figures disagree, you compared different columns than you thought.

If rows vanish that you meant to keep

  • You selected one column of a wider list. Excel warns you and offers to expand the selection — choose expand. Continuing with just the column shifts cells upward and each record falls apart. Select the whole list, then tick the one column you want compared.
  • The header row got compared. If My data has headers is unticked, the dialog shows "Column A" and treats row 1 as data.
  • Nothing is found, but you can see repeats. Suspect a trailing space, a text-formatted number, or two date formats. Fix those, then try again.
  • The command refuses to run. Remove Duplicates cannot process data with subtotals or an outline; clear those first.

The habit that makes this safe is the order of operations: copy the sheet, choose the key columns, preview with a helper column, clean the values that only look identical, sort for the row that should survive, and only then press the button. The four-second part is the last step, not the whole job.