Select your data, then go to Home › Conditional Formatting › Highlight Cells Rules › Duplicate Values and click OK. Excel colours every repeated value so you can spot duplicates instantly.

You often need to find duplicates when checking a guest list, a list of invoice numbers, or customer email addresses. Excel can highlight every repeated entry in a few clicks so you can decide what to keep or remove.
Step by step
- Select the cells you want to check, for example A2:A20. Include the header only if you want it checked too.
- On the Home tab, click Conditional Formatting.
- Point to Highlight Cells Rules, then click Duplicate Values.
- In the box on the left, keep Duplicate. In the box on the right, choose a format such as Light Red Fill with Dark Red Text.
- Click OK. Every value that appears more than once is now coloured.
- To remove the colours later, select the cells and choose Home › Conditional Formatting › Clear Rules › Clear Rules from Selected Cells.
On a Mac: On a Mac, the same path is on the Home tab: Conditional Formatting › Highlight Cells Rules › Duplicate Values.
Before and after
| A | B | C | |
|---|---|---|---|
| 1 | Name | ||
| 2 | Ana | ana@example.com | |
| 3 | Ben | ben@example.com | |
| 4 | Ana | ana@example.com | |
| 5 | Cara | cara@example.com |
| A | B | C | |
|---|---|---|---|
| 1 | Name | ||
| 2 | Ana | ana@example.com | |
| 3 | Ben | ben@example.com | |
| 4 | Ana | ana@example.com | |
| 5 | Cara | cara@example.com |
The macro
Press Alt+F11, choose Insert › Module, paste the code, then press F5 to run it. Save the file as .xlsm to keep the macro.
Highlight duplicates in the selected range
Sub HighlightDuplicates()
' Colour cells that appear more than once in the selection
Dim cell As Range
For Each cell In Selection
If WorksheetFunction.CountIf(Selection, cell.Value) > 1 Then
cell.Interior.Color = RGB(255, 199, 206) ' light red fill
End If
Next cell
End SubWith a formula instead
| Formula | Use it when |
|---|---|
=COUNTIF($A$2:$A$20,A2)>1 | You want a TRUE/FALSE flag next to each row instead of colours, for example to filter or sort duplicates. |
=UNIQUE(A2:A20) | You want a clean list with each value once (duplicates removed), without changing the original data. Use =UNIQUE(A2:A20,,TRUE) for only the values that appear exactly once. |
Practise it
Free exercises with instant feedback. No sign-up needed.
Common mistakes
- Only part of the list is selected, so some duplicates are missed. Select the whole column range you want to check, such as A2:A100, before applying the rule.
- The header is included in the selection. Start the selection at the first data row; the header is only coloured if the same text also appears in the data.
- Values that look identical aren't marked, because one has an extra space. Clean the data first with =TRIM(A2) in a helper column. Capitalisation doesn't matter: the rule ignores case.
Questions people also ask
How do I remove duplicates after finding them?
Select the data and use Data › Remove Duplicates. Excel keeps the first occurrence and deletes the rest.
Can I find duplicates across two columns?
Yes. Select both columns and apply the same Duplicate Values rule, or use =COUNTIF($B$2:$B$20,A2)>0 in a helper column.
Does conditional formatting change my data?
No. It only colours cells. The values stay exactly as they are until you edit or delete them yourself.
Functions used
Steps written for Excel for Microsoft 365 on Windows. All how-to guides