Excel Duplicates: How to Find and Return Them
In this article
Excel has no single "return duplicates" button, but three built-in tools do the job: Conditional Formatting > Highlight Cells Rules > Duplicate Values to mark duplicates in place, COUNTIF to return a TRUE/FALSE flag next to each row, and Data > Remove Duplicates to get a list of unique records (the opposite of what you want, useful for comparison). If you need a clean list of just the repeated values, the fastest reliable route is to flag them with COUNTIF, filter on the flag, then copy the visible rows elsewhere. This guide covers each method, plus how to decide when to use which.
What You'll Need
- Excel for Microsoft 365, Excel 2021/2019, Excel for Mac, or Excel for the web. Labels differ slightly between versions, desktop and web, and regions — if a wording looks different, look for the closest match.
- A workbook with your data in one sheet, ideally with a header row and no blank columns interrupting the table.
- Decide up front what counts as a duplicate: an exact match of the whole row, a match on one column (for example, email address), or a match on several columns combined.
- For anything destructive (deleting rows), work on a copy first. Keep the original sheet untouched.
Step-by-Step
- Set up your data. Put your data in a contiguous range with a single header row. Select any cell inside it and confirm Excel recognises it as a table (the header arrows appear when you press Ctrl+T / Cmd+T, but you can also leave it as a plain range). Blank rows in the middle break ranges, so remove them first.
- Mark duplicates visually with Conditional Formatting. Select the column or range to check. Go to Home > Conditional Formatting > Highlight Cells Rules > Duplicate Values. Choose the colour and click OK. Every value that appears more than once is now coloured. This is non-destructive and the best first look at your data.
- Return a TRUE/FALSE flag with COUNTIF. In a new column beside your data, type a formula such as
=COUNTIF($A$2:$A$1000, A2)>1. Copy it down the whole column. TRUE means that row's value appears more than once anywhere in the range; FALSE means it is unique. The dollar signs matter — they lock the range so the formula checks the full list for every row. - Return a count instead of a flag, if more useful. Use
=COUNTIF($A$2:$A$1000, A2)without the>1. This returns 1 for unique values and 2, 3, or more for repeat counts. Sort descending on this column to bring the most repeated values to the top. - For multi-column duplicates, use COUNTIFS. To treat a row as a duplicate only when two or more fields match together, use
=COUNTIFS($A$2:$A$1000,A2,$B$2:$B$1000,B2)>1. Each pair of range/criteria must cover the same number of rows. - Filter to see only the duplicates. Select your header row, go to Data > Filter. Click the arrow on the flag column and tick only TRUE. The sheet now shows only the repeated records. To return just one copy of each repeated value, you can copy the visible values into another sheet — but note that copy-paste includes all the rows, so deduplicate afterwards (next step).
- Get a clean list of duplicates using Remove Duplicates in reverse. Copy your filtered duplicate values to a spare column. Select that column and use Data > Remove Duplicates. Accept the warning, then click OK. You now have one copy of each value that was repeated, plus any accidental singles you may want to delete by eye. Run this on a copy — Remove Duplicates deletes rows permanently.
- Use Remove Duplicates to test for duplicates. Select your table, go to Data > Remove Duplicates, tick the columns that define a duplicate, and click OK. Excel reports how many duplicate rows were removed and how many unique remain. If it reports zero removed, your data is clean. Undo (Ctrl+Z / Cmd+Z) immediately afterwards if you only wanted the count.
- Check the answer. Compare counts: total rows minus unique rows should equal the number of duplicates reported. If they disagree, blank cells or trailing spaces are usually the culprit.
Common Mistakes
Ranges that do not lock. Using $A2:$A$1000 or A2:A1000 instead of $A$2:$A$1000 makes the range slide as you copy down, so later rows check a shrinking window and miss duplicates. Use absolute references for the range and a relative reference for the cell being tested.
Invisible spaces. "John " and "John" look identical but COUNTIF treats them as different, so real duplicates come back FALSE. Clean them with =TRIM() or Ctrl+H (find a space, replace with nothing) before checking.
Case sensitivity. COUNTIF and Conditional Formatting ignore case by default, so "ABC" and "abc" count as duplicates. If you need case-sensitive matching, use =SUMPRODUCT(--EXACT($A$2:$A$1000,A2))>1 — more complex, but exact.
Formatting differences. Text-formatted numbers ("00123") versus real numbers (123), or dates stored as text, are not treated as equal. Convert with Data > Text to Columns or format the whole column consistently.
Running Remove Duplicates on the original sheet. It permanently deletes rows, and Undo does not always restore everything in shared or large workbooks. Always work on a copy, and never run it on a sheet linked to other formulas without checking.
Forgetting that a merged cell or a hidden filter hides duplicates. Remove any merged cells before filtering or deduplicating, and clear filters so hidden rows are not silently skipped.
Tips
Convert your range to a table (Ctrl+T / Cmd+T) before adding COUNTIF flags. When you later add rows, the formula and formatting extend automatically, so you do not have to recopy it.
Put the flag column first, directly beside your data, and give it a clear header like "Is Duplicate". Filtering on a named column is far less error-prone than filtering on an unnamed one.
Use Conditional Formatting as a live audit. Duplicate highlighting recalculates as you edit, so you can spot a repeat entry the moment it is typed — better than a one-off COUNTIF you forget to refresh.
For big lists, replace full-column references such as $A:$A with a bounded range like $A$2:$A$5000. COUNTIF over entire columns can be slow and can count header cells unexpectedly.
If you want the repeated values themselves, not just a flag, the newest Excel versions support =UNIQUE() and =FILTER(). =FILTER(A2:A1000, COUNTIF(A2:A1000, A2:A1000)>1) returns only the duplicated entries in one spill. Older versions can use INDEX/MATCH or the filter-and-copy method above.
Always verify a deduplicated list against the original count. If the numbers do not match, the cause is nearly always blank cells, spaces, or a mixed number/text column.
Troubleshooting
Nothing is highlighted. You selected only one cell, not a range. Re-select the whole column and try again. Also check that no filter is hiding the coloured rows.
Everything is highlighted. Your selection included the header row, and the header text repeats nowhere — or every value really is repeated. Check the range boundaries.
COUNTIF returns 0 for a value you can plainly see. The value differs by a hidden space, a non-breaking space, or a number stored as text. Clean the data with TRIM and CLEAN, or select the column and apply Data > Text to Columns accepted with default settings to force a type.
Remove Duplicates reports zero removed. The selected range probably excludes one column that defines the record, or the rows differ in a column you ticked. Untick everything and tick only the columns that should match.
The unique list is not what you expected. Remove Duplicates is case-insensitive and ignores format, but respects number versus text. Compare a few pairs manually with =EXACT(A2, A3) and =LEN(A2)=LEN(A3) to find the mismatch.
Excel is slow or freezes. Large COUNTIF arrays over whole columns are the usual cause. Limit the range, or copy the flags and paste them as values (Ctrl+Shift+V / Paste Special > Values) once calculated, then delete the formulas.
Frequently Asked Questions
How do I return only the duplicate rows, not the whole list?
Use COUNTIF to flag rows where the count is greater than 1, then filter the flag column to TRUE. The sheet then shows only duplicates. Copy the visible rows to a separate sheet if you need them isolated; note that copy-paste includes every visible row, so each repeated value appears as many times as it repeats.
What is the difference between Remove Duplicates and my COUNTIF flag?
Remove Duplicates deletes rows and leaves one unique copy of each record. COUNTIF changes nothing — it only reports counts or TRUE/FALSE values. Use the flag for reporting and the delete function when you genuinely want a clean, unique dataset.
Can I find duplicates across two columns, not one?
Yes. Use COUNTIFS with a pair of ranges and pair of criteria, for example =COUNTIFS($A$2:$A$1000,A2,$B$2:$B$1000,B2)>1. Only rows that match on both columns are counted as duplicates.
Does Excel ignore case when finding duplicates?
Conditional Formatting and COUNTIF treat "Apple" and "apple" as the same value. For case-sensitive matching, use EXACT inside SUMPRODUCT.
Why do identical-looking values show as unique?
Usually a trailing space, a number stored as text, or a hidden non-printing character. TRIM, CLEAN, and Text to Columns clear these up.
Can I just return a list of duplicates with a formula?
In Excel for Microsoft 365 and newer 2021 versions, a FILTER formula combined with COUNTIF returns a live, spilling list of every duplicated value. Older versions need the filter-and-copy approach or INDEX/MATCH.