The short answer
Excel gives you four ways to deal with duplicates, and they do very different jobs. Conditional formatting colours every repeated value so you can see it. A COUNTIF helper column marks each row TRUE or FALSE so you can filter, sort and count. Remove Duplicates deletes the repeated rows outright. The UNIQUE function writes a clean list somewhere else and leaves your source data alone.
If you only need to look, use conditional formatting. If you need to check, count or hand a list to someone else, use COUNTIF. Only reach for Remove Duplicates once you are certain the extra rows are expendable — it is the one option that destroys data.
- Highlight Cells Rules
- Home → Conditional Formatting → Highlight Cells Rules → Duplicate Values. Purely visual; nothing is changed or deleted.
- COUNTIF helper column
- =COUNTIF($A$2:$A$1000,A2)>1 in a spare column, then filter for TRUE. Adds a column but gives you a sortable, countable record.
- Remove Duplicates
- Data → Remove Duplicates. Deletes repeated rows permanently, keeping the first occurrence of each.
- UNIQUE function
- =UNIQUE(A2:A1000) spills a de-duplicated list into empty cells. Microsoft 365 and Excel 2021 onwards only.
Before you start
A few minutes of preparation saves an hour of repair:
- Work on a copy. Save the workbook under a second name, or right-click the sheet tab and choose Move or Copy with Create a copy ticked. Deletion mistakes are much easier to reverse on a copy.
- Decide what counts as a duplicate. Same surname in the same column? Same postcode? The whole row matching across five columns? The answer changes which method you need.
- Tidy the block first. No blank rows or columns inside the range, no merged cells, and one header row at the top. Merged cells in particular break both filtering and Remove Duplicates.
- Check for a filter already switched on. If rows are hidden by an old filter, the tools may act on rows you cannot see.
Step by step: highlight duplicates with conditional formatting
-
01 /
Select the cells you want to check
Click the first data cell below the header and press Ctrl + Shift + ↓ to run down to the last filled cell. If your column has gaps, type the range into the Name Box instead — for example A2:A5000 — and press Enter.
-
02 /
Open the Duplicate Values rule
Go to Home → Conditional Formatting → Highlight Cells Rules → Duplicate Values. The left-hand dropdown should already read Duplicate; leave it as it is.
-
03 /
Choose a format you can spot
Pick a preset such as Light Red Fill with Dark Red Text, or use Custom Format to set your own fill colour. Click OK. Every repeated value is now coloured, including the first copy of each one.
-
04 /
Turn the colour into a working list
Select the data, go to Data → Filter, open the filter arrow on that column and choose Filter by Color, then pick your highlight colour. What you see is the duplicate set, ready to copy to another sheet or inspect row by row.
-
05 /
Clear the rule when you have finished
Select the range again and go to Conditional Formatting → Clear Rules → Clear Rules from Selected Cells. The colouring disappears; the data underneath was never touched.
Step by step: list the duplicates with COUNTIF
-
01 /
Add a helper column
Click the header of the first empty column to the right of your data and type a label such as Repeat?. This keeps your working formula out of the way of the real data.
-
02 /
Write the COUNTIF formula
In the first data row of that column type =COUNTIF($A$2:$A$1000,A2)>1 and press Enter. The dollar signs lock the range so it does not slide about when you copy the formula down.
-
03 /
Fill it down
Double-click the small square at the bottom-right corner of the cell, or drag it to the last row. Each row now reads TRUE or FALSE.
-
04 /
Filter or sort for TRUE
Filter the helper column to TRUE to see only the repeats, or sort by it to group them together. Because the result is an ordinary value, you can count them with =COUNTIF(B2:B1000,TRUE).
-
05 /
Get a count instead of a yes/no
Remove the >1 and the formula returns how many times each value appears. That is often more useful than a yes/no, especially when a value might legitimately appear twice.
If your data sits in a proper Excel table (Ctrl + T), the structured version =COUNTIF([Surname],[@Surname])>1 grows automatically as you add rows, and you never have to adjust the range again.
Find duplicate rows across several columns
A single column is straightforward. A whole row is not, because Excel has to agree on all the columns at once before calling anything a duplicate.
-
01 /
Build a key column
In a spare column, join the fields you care about: =TRIM(A2)&"|"&TRIM(B2)&","&TRIM(C2). The pipe and comma separators stop two different rows from producing the same string by accident.
-
02 /
Count the keys
Use =COUNTIF($D$2:$D$1000,D2)>1 on that key column, exactly as you would with a single column, then filter for TRUE.
-
03 /
Or skip the key entirely with COUNTIFS
=COUNTIFS($A$2:$A$1000,A2,$B$2:$B$1000,B2,$C$2:$C$1000,C2)>1 does the same job without a helper string, but the formula gets long quickly beyond three or four columns.
-
04 /
Read across the flagged rows
Filter for TRUE and compare full rows side by side. Seeing the whole record is what tells you whether the repeat is a genuine duplicate or two different people with the same details.
Step by step: remove duplicates without losing the rows you need
-
01 /
Save a copy first
Use File → Save As and add a suffix such as -working to the name. If anything goes wrong you still have the untouched original.
-
02 /
Select the whole block
Include the header row and every column that belongs to the record. Do not leave a blank column inside the selection — Excel will treat the two halves as separate lists.
-
03 /
Open Remove Duplicates
Go to Data → Remove Duplicates. A dialog appears listing every column in your selection.
-
04 /
Tick My data has headers, then choose the columns
Tick the box if row one really is a header. Then tick only the columns that must match for a row to count as a repeat — leave the rest unticked, or nothing will ever be flagged.
-
05 /
Read the message before you trust it
Excel reports how many duplicates were removed and how many unique values remain. Check those numbers against what you expected. If they look wrong, press Ctrl + Z immediately, before saving.
-
06 /
Check the result against the original
Switch to your copy and run the COUNTIF check there. A quick row count on both sheets is the simplest way to confirm that exactly the expected rows disappeared and no others.
Get a clean unique list with UNIQUE
-
01 /
Pick an empty landing area
Choose a new sheet, or a few clear columns to the right of your data. If anything is in the way you will get a #SPILL! error rather than a list.
-
02 /
Spill a de-duplicated list
Type =UNIQUE(A2:A1000) and press Enter. One formula produces the whole clean list, which grows and shrinks as the source changes.
-
03 /
Show only the values that appear once
=UNIQUE(A2:A1000,,TRUE) returns the entries that occur exactly once — useful for spotting the rows that are not repeats.
-
04 /
Count how many extras you have
=ROWS(A2:A1000)-ROWS(UNIQUE(A2:A1000)) tells you how many surplus duplicates exist. If the answer is zero, your list is already clean and there is nothing to fix.
Because UNIQUE writes to a separate range, it is the safest option for a recurring job: your source list stays exactly as imported, and the tidy version refreshes every time the data changes.
Which method should you use?
| Method | What it does | Changes your data? | Best for |
|---|---|---|---|
| Conditional formatting | Colours every repeated value where it sits | No — visual only | A quick visual check of a list you can scan by eye |
| COUNTIF helper column | Marks each row TRUE or FALSE so it can be filtered | Adds a column | Counting, filtering and keeping a record of what you found |
| Remove Duplicates | Deletes repeated rows and keeps the first occurrence | Yes — permanently | A one-off clean-up of a list you have already checked |
| UNIQUE function | Spills a de-duplicated list into empty cells | No — writes to a new range | Microsoft 365 or Excel 2021 onwards, especially for repeat jobs |
What usually goes wrong, and how to fix it
Most "Excel says there are no duplicates" complaints come down to invisible differences between values that look identical on screen:
- Trailing or double spaces. "Smith " and "Smith" are two different entries. Clean the column in a helper column with =TRIM(A2), then run the check on the cleaned version.
- Rubbish characters from exports. Data pasted from a CRM or an old system often carries non-printing characters. =TRIM(CLEAN(A2)) strips both the spaces and the hidden characters.
- Numbers stored as text. A cell holding the text "01234" does not match the number 1234. Convert it with Text to Columns (choose the column, click Finish) or =VALUE(A2).
- Case differences. Excel's duplicate tools ignore capitalisation, so "apple" and "Apple" are flagged as the same. If that is wrong for your data, you need an exact check.
- Blank cells versus cells with a space. Conditional formatting ignores genuinely empty cells, but a cell containing a single space is not empty and will be flagged.
- Whole-column references. =COUNTIF($A:$A,A2) on a 100,000-row file will crawl. Point the formula at a bounded range, or convert the data to a table.
Case-sensitive and near-match duplicates
When capitalisation matters — product codes, usernames, email aliases — the built-in tools will over-report. Use an exact-match formula instead:
- In a helper column: =SUMPRODUCT(--EXACT(A2,$A$2:$A$1000))>1. This counts only values that match character for character, including case.
- To pull every instance at once: =FILTER(A2:A1000,COUNTIF(A2:A1000,A2:A1000)>1) on Microsoft 365 or Excel 2021 onwards. The result is a self-contained duplicate list you can paste as values into a new sheet.
- For near-matches rather than exact ones — slightly different spellings of the same company, for example — no formula will do the job reliably. Sort the column alphabetically and read down it, which puts lookalikes next to each other where you can judge them.
Keeping a record before you delete anything
If the spreadsheet is shared, imported or audited, leaving a trail matters as much as the clean-up itself:
- Keep the original sheet in the workbook and put the cleaned version on a new sheet, named so nobody has to guess which is which.
- Add a column noting why each row was removed, or copy the flagged rows to a sheet called Removed before you delete them.
- Note the row count before and after. If the two numbers ever need explaining later, that single figure usually settles the question.
Frequently asked questions
Does highlighting duplicates with conditional formatting delete anything?
No. Conditional formatting only changes how cells look, and the values stay exactly as they were. Deleting the coloured rows is a separate step that you take yourself, which is why the highlight method is the safest place to start.
Can I compare two different sheets for duplicates?
Yes. Point a COUNTIF at the other sheet with an absolute reference, for example =COUNTIF(Lists!$A$2:$A$500,A2)>1, then filter for TRUE. Conditional formatting can do the same job with a formula rule built on that reference.
Why is Excel not flagging a duplicate I can see with my own eyes?
There is almost always a hidden difference: a trailing space, a non-printing character from an export, a capital letter, or a number stored as text. Clean the column with TRIM and CLEAN, convert the text-numbers back to numbers, then run the check again.
Is there a limit on how many duplicates Excel can handle?
The limit is the sheet itself — 1,048,576 rows and 16,384 columns — rather than the number of repeats. What does slow things down is whole-column references such as $A:$A on a large file, so use a bounded range or an Excel table.
What is the difference between Duplicate and Unique in the Duplicate Values menu?
Duplicate colours every value that appears more than once, including all of its copies. Unique colours only the values that appear exactly once, which is more useful when you are hunting the odd one out rather than the repeats.



