Excel Guide

How to Remove Duplicates in Excel: Find Them First, Then Delete Only the Repeats

Short answer: click any cell inside your list, go to Data > Remove Duplicates, tick the columns that together make a row a repeat, and click OK. Excel keeps the first occurrence of each value and deletes the later copies, then tells you how many duplicates it removed and how many unique values remain. The deletion is permanent — Microsoft's own advice is to copy the original data to another sheet or workbook before you start. Practise the counting half first: COUNTIF — 10 Excel practice problems.

The steps, as Microsoft documents them

  1. Select the range of cells, or make sure the active cell is inside a table.
  2. On the Data tab, select Remove Duplicates in the Data Tools group. The keyboard route is Alt, then A, then M.
  3. Under Columns, tick the columns Excel should compare. Select All and Unselect All are shortcuts for ticking or clearing them all at once.
  4. Leave My data has headers ticked if the first row holds column names, so the boxes under Columns carry those names.
  5. Select OK. A message reports how many duplicate values were removed, or how many unique values remain. If the result is wrong, undo immediately with Ctrl+Z.

One more Microsoft detail worth knowing before you click OK: you cannot remove duplicates from data that is outlined or has subtotals — remove the outline and the subtotals first.

The one decision that matters: which columns to tick

Microsoft defines a duplicate as a row whose values are identical to another row's — on the columns you ticked. The ticked columns are only the matching key; they are not the only thing deleted. If you tick Customer and Product but not Amount, two rows with the same customer and product count as duplicates, and Excel deletes the whole row, including the Amount column you left unticked. Data outside the selected range or table is not touched, which is why it helps to select the full table first.

Find them before you delete them

Because the deletion is permanent, look first and delete second:

Filtering for unique values is a third option, but it is not the same job: Microsoft is explicit that filtering only hides duplicates temporarily, while removing them deletes them permanently.

When Excel says there are no duplicates — but you can see them

Two cells that look identical can still be different values to Excel. The usual suspect is a stray space: in a test on Excel for Microsoft 365, a trailing space was enough for Excel to treat two otherwise identical entries as different, while capital letters were ignored. If Remove Duplicates leaves repeats behind, clean the text first — TRIM removes leading and trailing spaces and collapses doubled internal spaces to single spaces — then run Remove Duplicates again. Pasting from another system can also leave invisible control characters in the text; that is what CLEAN is for.

Also treat the count in the confirmation message as a guide rather than a perfect headcount: Microsoft notes it can include blank cells and cells containing only spaces.

The non-destructive alternative: UNIQUE

If you want a clean list but need the original untouched, do not delete anything — build the clean list beside it. In Microsoft 365, Excel 2021 and Excel 2024 (and the Excel web and mobile apps), =UNIQUE(A2:A11) writes the unique values into neighbouring cells and leaves the source exactly as it is. It is the right choice when the original list has to stay for audit, or when you are not yet sure which rows are the repeats.

Practise it

The COUNTIF topic page has 10 exercises that build up step by step — counting high scores, counting orders from one region, counting items below a threshold, and more. Three are free with worked solutions and no sign-up needed; the rest are graded on the formula you write in the live spreadsheet. COUNTIF is the counting half of this job: use it to find out how often each entry appears before you decide what to delete.

The TRIM and CLEAN topic page has 10 exercises on the cleaning half — trimming a messy name entry, combining TRIM and PROPER for clean formatting, trimming whitespace from a pasted value, and removing non-printable characters from imported text. Three are free with worked solutions. Work through the cleaning exercises first if your list came from a paste or an import, then browse the full list of topics on the practice hub.

Try it yourself

Practice COUNTIF with real interactive exercises and instant feedback.

Start practicing COUNTIF →