How to Quickly Find Duplicates in Excel
In this article
To quickly find duplicates in Excel, use Conditional Formatting: select your data, go to Home > Conditional Formatting > Highlight Cells Rules > Duplicate Values, and click OK. This highlights every repeated value in the selected range. For a count, use COUNTIF; to remove duplicates, use Data > Remove Duplicates. The steps below cover each method, plus what to do when the highlight misses duplicates you know are there.
What You'll Need
- Excel for Windows, Mac, or the web (the ribbon labels below are from current desktop versions; labels can differ slightly by version, device, or region).
- Your data in a single contiguous range or an Excel Table (Ctrl+T on Windows, Cmd+T on Mac).
- Optional: a helper column if you want to mark duplicates without changing the original data.
Step-by-Step
- Select the range you want to check. Click the first cell and drag to the last, or press Ctrl+A (Cmd+A on Mac) inside the data. Include headers only if you want them checked too; otherwise start from the first data row. If your data is an Excel Table, select any cell inside it and the whole table is used.
- Open Conditional Formatting. On the Home tab, click Conditional Formatting > Highlight Cells Rules > Duplicate Values.
- Choose the format and confirm. In the dialog, pick a preset such as Light Red Fill with Dark Red Text, or choose Custom Format to set your own fill or font. Click OK. Every value that appears more than once in the selected range is now highlighted.
- Read the result. Both the first occurrence and every repeat are highlighted, so a value that appears three times shows three coloured cells. This is expected: the rule marks all instances, not just the extras.
- Count occurrences with COUNTIF (optional). In an empty column beside your data, enter
=COUNTIF($A$2:$A$100,A2)and fill down. Replace the range with your actual range and A2 with the first cell of the column you are checking. A result of 1 means unique; 2 or more means duplicated. This gives you a sortable count instead of just a colour. - Remove duplicates if that is the goal. Select the range or click inside your table, then go to Data > Remove Duplicates. Tick the columns that define a duplicate (for example, just Email, or Email plus Date), then click OK. Excel reports how many values were removed and how many remain. This deletes rows permanently in the current file, so save a copy first or work on a duplicate sheet.
- Use a formula to flag rows without deleting anything. In a helper column, enter
=IF(COUNTIF($A$2:$A$100,A2)>1,"Duplicate","")and fill down. You can then filter that column for "Duplicate" to review the rows before deciding what to keep. - Check for near-duplicates. Conditional Formatting matches exact values only. "John Smith" and "john smith " (with a trailing space) are different to Excel. Use TRIM and LOWER in a helper column, for example
=LOWER(TRIM(A2)), then run the duplicate check on that cleaned column.
Common Mistakes
- Selecting only part of the data. If the range stops short, duplicates outside it are missed. Press Ctrl+End (Cmd+End on Mac) to see where your data actually ends, or convert the range to a Table so it expands automatically.
- Expecting only the extra copies to be highlighted. The built-in rule marks every occurrence, including the first. Use COUNTIF if you need to distinguish the original from the repeats.
- Running Remove Duplicates on the wrong columns. With several columns ticked, a row is only removed when all ticked columns match. Tick too many and real duplicates survive; tick too few and you delete rows you meant to keep.
- Ignoring hidden spaces and case. Values pasted from other systems often carry leading or trailing spaces. Excel treats "Apple" and "Apple " as different, so clean the data first.
- Forgetting that Remove Duplicates is permanent. It changes the file immediately. Undo (Ctrl+Z) may help right after, but once you save and close, the removed rows are gone. Keep a backup copy.
Tips
- Convert your range to a Table before checking. The formatting rule and formulas then follow the table as rows are added.
- To highlight duplicates across two columns (for example, comparing list A with list B), use a formula-based rule: select the second list, choose Home > Conditional Formatting > New Rule > Use a formula to determine which cells to format, and enter a COUNTIF formula that refers to the first list.
- Sort by your COUNTIF column descending to bring the most-repeated values to the top for review.
- If you only want to see duplicates and hide the rest, apply an AutoFilter on the helper column and select "Duplicate".
- For a quick visual check on a small list, the duplicate highlight is faster than any formula. For anything you need to report on, the COUNTIF column is more reliable because it gives numbers, not colours.
Troubleshooting
- Nothing is highlighted. Check that you selected the full range and that the cells contain values, not formulas returning blanks. Also confirm the rule was applied to the right sheet; rules belong to the sheet where you created them.
- Duplicates you can see are not flagged. Look for extra spaces, non-breaking spaces, or numbers stored as text (a green triangle in the corner of the cell). Clean with TRIM and VALUE, or use Text to Columns, then re-run the check.
- The highlight covers cells you did not expect. Blank cells can be treated as duplicates of each other. Limit the range to rows that contain data, or add a rule condition that ignores blanks.
- Remove Duplicates removed too much. Press Ctrl+Z immediately. If that is not enough, close the file without saving and reopen it. Going forward, work on a copy of the sheet.
- The rule will not go away. Select the range, then Home > Conditional Formatting > Clear Rules > Clear Rules from Selected Cells. To remove every rule on the sheet, choose Clear Rules from Entire Sheet.
Frequently Asked Questions
Does Conditional Formatting find duplicates across multiple columns?
Yes, if you select all the columns together. Excel compares every cell in the selected range against every other cell, so a value repeated in column B and column D is highlighted. If you want to compare two separate lists, use a formula-based rule with COUNTIF instead.
Can I find duplicates without changing the formatting?
Yes. Use a COUNTIF formula in a helper column, or Data > Remove Duplicates on a copy of the sheet. Both give you a result without adding colour to the original cells.
Why does Excel treat two identical-looking values as different?
Usually because of hidden characters: leading or trailing spaces, non-breaking spaces, or one value stored as text and the other as a number. Clean the column with TRIM and check the cell format before running the duplicate check again.
Does Remove Duplicates keep the first or the last copy?
It keeps the first occurrence it encounters in the current row order and removes the later ones. Sort the data first if you want a particular row, such as the most recent date, to be the one that survives.
Can I find duplicates in Excel for the web?
Yes. Conditional Formatting with the Duplicate Values rule and the COUNTIF function both work in Excel for the web. Remove Duplicates is also available there, but the exact menu position can differ slightly from the desktop app.