Home › Excel basics › Remove duplicates
How to Find, Highlight and Remove Duplicates in Excel
Duplicates creep in when lists are merged, exported twice or typed by hand. Excel gives you several ways to deal with them, from simply highlighting them to deleting them in one click.
In this guide
Step 1: highlight duplicates first
Before deleting anything, see what you're dealing with:
- Select the column, for example the email addresses.
- Go to Home › Conditional Formatting › Highlight Cells Rules › Duplicate Values.
- Click OK. Every value that appears more than once is colored.
Combine this with a filter by color (Ctrl+Shift+L) to see only the duplicates. More in conditional formatting.
Flag duplicates with a formula
A helper column tells you exactly how often each value occurs:
=COUNTIF($A$2:$A$500, A2)A result of 2 or more means it's a duplicate. To mark only the second and later occurrences (so you can keep the first), use an expanding range:
=IF(COUNTIF($A$2:A2, A2)>1, "Duplicate", "")See COUNTIF for more.
Delete duplicates with Remove Duplicates
- Click inside your data.
- Go to Data › Remove Duplicates.
- Tick the columns that together define a duplicate. Tick only "Email" to treat rows with the same email as duplicates; tick all columns to remove only completely identical rows.
- Click OK. Excel reports how many duplicates it removed and how many unique values remain.
Remove Duplicates permanently deletes rows and always keeps the first occurrence from the top. Work on a copy, or sort the data first so the row you want to keep (for example the most recent one) comes first. Ctrl+Z undoes it straight away.
List unique values without deleting anything
In Microsoft 365 and Excel 2021+, the UNIQUE function creates a live list without duplicates and leaves your data untouched:
=UNIQUE(A2:A500)Use =UNIQUE(A2:C500) for unique rows across several columns. See UNIQUE.
Duplicates that Excel doesn't see
"Anna Jansen" and "anna jansen " look like duplicates to you, but the trailing space makes them different to Remove Duplicates. Clean the data first:
- Remove extra spaces with TRIM.
- Make capitalization consistent with UPPER, LOWER or PROPER. (Remove Duplicates itself ignores case.)
Frequently asked questions
Does Remove Duplicates keep the first or the last occurrence?
The first one, counting from the top. Sort your data first if you want to keep a specific occurrence.
Is Remove Duplicates case-sensitive?
No. "ANNA" and "anna" are treated as duplicates.
How do I count unique values?
In Microsoft 365 or Excel 2021+, use =COUNTA(UNIQUE(A2:A500)).
How do I find duplicates across two columns?
Use COUNTIF on the other column: =COUNTIF($B$2:$B$500, A2)>0 returns TRUE when a value in column A also appears in column B.