Mark duplicates with conditional formatting instead of deleting them
The safest way to identify duplicates in Excel is to highlight them with color or formatting, then decide what to do with each one. Excel's conditional formatting feature can flag duplicate values automatically without touching your data. This gives you a chance to review what's actually duplicated before anything disappears.
If you delete duplicates directly, Excel removes the entire row permanently — and if you made a mistake about what counts as a duplicate, you cannot undo it after you close the file. Highlighting first means you can see the pattern, understand why the duplicate exists, and choose whether to keep it, merge it, or flag it for investigation.
Key Takeaways
- Conditional formatting highlights duplicates with color or formatting so you can see them without deleting anything.
- Select the column or range you want to check, then use Home > Conditional Formatting > Highlight Cell Rules > Duplicate Values.
- Excel considers a value a duplicate if it appears more than once in the range you selected — so the first occurrence gets highlighted too.
- Filter by the highlight color afterward to see only duplicates grouped together, making it easier to decide what to do with each one.
- If you need to remove duplicates later, you can use Data > Remove Duplicates on the highlighted rows, but only after you have reviewed them.
Using conditional formatting to highlight duplicates
Open your spreadsheet and select the column or range where you want to find duplicates. Click the column header to select the entire column, or drag to select just the cells you need to check. If your data has headers (like "Name" or "Email"), include only the data rows, not the header itself.
Go to the Home tab in the ribbon. Click Conditional Formatting, then hover over Highlight Cell Rules, and click Duplicate Values. A dialog box appears with two dropdowns. The first one says "Duplicate" — leave that as is. The second one lets you choose the color or format. Pick a color that stands out, like light red or yellow, then click OK.
Excel now highlights every cell in your selection that contains a value appearing more than once. This includes the first occurrence of the duplicate, not just the second and third. So if "John Smith" appears three times, all three cells turn the highlight color.
Understanding what Excel counts as a duplicate
Excel's duplicate detection is exact — it looks for cells with identical text or numbers. "John Smith" and "john smith" are different because of the capital letters. "123" and "123.0" are different because one is text and one is a number. Spaces matter too: "Smith " with a trailing space is not the same as "Smith" without one.
If your data has extra spaces, inconsistent capitalization, or mixed formats, you may have real duplicates that Excel does not flag. Before you trust the highlighting, scan the data yourself or use Find & Replace to clean up obvious formatting issues first. For example, use Find & Replace to remove leading and trailing spaces: press Ctrl+H, search for " *$" (with regular expressions enabled), replace with nothing, and run it on the column.
Filtering to see only the highlighted duplicates
Once the duplicates are highlighted, you can filter the view to show only those rows. Click anywhere in your data range, then go to Data > AutoFilter. Dropdown arrows appear in the header row. Click the dropdown for the column you highlighted, uncheck "All", then check only the highlight color you used. The spreadsheet now shows only the duplicate rows.
This grouped view makes it much easier to understand the pattern. You can see all instances of "John Smith" together, all instances of a duplicate email address together, and so on. From here you can manually delete rows you do not need, merge information from duplicates into a single row, or add a note in another column to flag them for follow-up.
Removing duplicates after you have reviewed them
If you decide you want to delete duplicate rows, do it only after you have looked at them. First, remove the conditional formatting so Excel does not get confused. Select the highlighted range, go to Home > Conditional Formatting > Manage Rules, select the rule, click Delete Rule, and click OK.
Now select the entire data range including headers. Go to Data > Remove Duplicates. A dialog appears listing all your columns. Uncheck any columns you do not want to use for comparison — for example, if you only care about duplicate email addresses, uncheck Name and Phone. Click OK. Excel removes rows where the checked columns match exactly, keeping the first occurrence of each duplicate and deleting the rest.
A message tells you how many rows were removed. If the number surprises you, press Ctrl+Z immediately to undo and review the data again before trying a different approach.
Comparing two columns to find matches
Sometimes you need to find duplicates across two different columns — for example, checking whether an email address in Column A also appears in Column B. Conditional formatting does not do this directly, but you can use a helper column with a formula.
Click an empty column next to your data. In the first data row, type the formula =COUNTIF($B:$B,A2), replacing B with the column you want to search and A with the column you are checking. This formula counts how many times the value in A2 appears anywhere in column B. If the result is 1 or higher, the value exists in both columns. Copy this formula down the entire column, then use conditional formatting on the helper column to highlight any cell with a value greater than 0.
Finding near-duplicates and typos
Excel's built-in duplicate finder only catches exact matches. If you have "John Smyth" and "John Smith" in the same list, Excel treats them as different values even though they are probably the same person with a typo.
To find these near-duplicates, sort your data alphabetically by the column you want to check. Similar names and values cluster together, making typos and variations obvious when you scan the list. You can also use a formula like =SUMPRODUCT(--(LEN(A2)=LEN($A$2:$A$100)),--(SUMPRODUCT(--EXACT(MID($A$2:$A$100,ROW(INDIRECT("1:"&LEN(A2))),1),MID(A2,ROW(INDIRECT("1:"&LEN(A2))),1)))>=LEN(A2)-2)) to find values that differ by only a few characters, but this is complex. For most cases, sorting and visual inspection is faster and more reliable.
Frequently Asked Questions
Does conditional formatting delete my data?
No. Conditional formatting only changes how cells look — it adds color or formatting to cells that meet the rule. Your actual data stays exactly the same. You can remove the formatting anytime by going to Home > Conditional Formatting > Manage Rules, selecting the rule, and clicking Delete Rule.
Why does Excel highlight the first occurrence of a duplicate?
Excel's Duplicate Values rule highlights every cell that contains a value appearing more than once in your range. Since the first occurrence is part of that group, it gets highlighted too. This is actually helpful because it shows you the entire set of duplicates at once instead of just the second and third copies.
Can I highlight duplicates in multiple columns at once?
Yes. Select all the columns you want to check by clicking the first column header, holding Shift, and clicking the last column header. Then apply conditional formatting as usual. Excel will highlight any value that appears more than once anywhere in your selection, even if the duplicates are in different columns.
What if I want to keep one copy of each duplicate but mark the others?
After highlighting, filter to show only the duplicates. Manually delete or move the rows you do not need, keeping the first or most complete version of each duplicate. This gives you control over which copy survives instead of letting Excel choose randomly.
Can I undo Remove Duplicates if I change my mind?
Yes, but only immediately. Press Ctrl+Z right after the deletion to undo. If you close the file without undoing, the deleted rows are gone permanently. This is why reviewing duplicates with highlighting first is safer than using Remove Duplicates without looking.