The fastest way to spot duplicates in Excel
Excel has a built-in tool called Conditional Formatting that highlights duplicate values automatically. Select the cells you want to check, go to the Home tab, click Conditional Formatting, choose Highlight Cell Rules, then select Duplicate Values. Excel will shade every duplicate entry in that range with a color you pick.
If you need a list of just the duplicates rather than highlighting them in place, use the COUNTIF function to count how many times each value appears. In a new column next to your data, type =COUNTIF($A$2:$A$100,A2) (adjusting the range to match your data), then copy the formula down. Any cell showing a number higher than 1 contains a duplicate.
For larger datasets or more control over which columns to check, the Remove Duplicates feature lets you delete duplicate rows entirely. Select your data, go to the Data tab, click Remove Duplicates, choose which columns to compare, and Excel removes any rows that match on those columns. This is permanent, so copy your data first if you want to keep the original.
Key Takeaways
- Conditional Formatting highlights duplicates in place without changing your data, and takes about 10 seconds to set up.
- The COUNTIF function creates a helper column showing how many times each value appears, letting you filter or sort by that count.
- Remove Duplicates deletes entire rows that match on columns you specify, which is permanent and best used on a copy of your data.
- For checking if one value appears in another column, use COUNTIF with a different range, like =COUNTIF($B$2:$B$100,A2).
- All three methods work on text, numbers, and dates, but be aware that Excel treats "Smith" and "smith" as different values unless you change that setting.
Using Conditional Formatting to highlight duplicates
Conditional Formatting is the quickest visual way to spot duplicates. Select the range of cells you want to check — click the first cell, hold Shift, and click the last cell, or drag to select a block. If your data has headers, include them or start from the first data row; it does not matter which.
Go to the Home tab in the ribbon, click Conditional Formatting (it is in the Styles group), hover over Highlight Cell Rules, and click Duplicate Values. A dialog box appears asking what color to use for duplicates. Pick a color and click OK. Every cell in your selection that appears more than once will be shaded immediately.
To remove the highlighting later, select the same range again, go to Conditional Formatting, click Clear Rules, and choose Clear Rules from Selected Cells. The data stays; only the formatting disappears. This method is non-destructive and lets you see duplicates in context with the rest of your spreadsheet.
Finding duplicates with COUNTIF formulas
The COUNTIF function counts how many times a value appears in a range. Create a helper column next to your data — if your data is in column A, put the formula in column B. In the first data row of column B, type =COUNTIF($A$2:$A$100,A2), replacing A2:A100 with the actual range of your data and A2 with the first cell you want to check.
The dollar signs ($) lock the range so it does not change when you copy the formula down. Copy the formula to every row in column B that has data in column A. Each cell in column B will now show a number: 1 means that value appears once (not a duplicate), 2 means it appears twice, 3 means three times, and so on.
You can then sort or filter by column B to group duplicates together, or use column B to identify which rows to investigate further. This method keeps your original data intact and gives you a count you can work with. If you want to check whether a value in column A appears anywhere in column C, use =COUNTIF($C$2:$C$100,A2) instead — same idea, different range.
Removing duplicate rows entirely
The Remove Duplicates feature deletes entire rows that match on the columns you specify. This is permanent, so always work on a copy of your data first. Select the entire data range including headers, go to the Data tab, and click Remove Duplicates (it is in the Data Tools group).
A dialog box lists all the columns in your selection. By default, all columns are checked, which means Excel will only delete a row if every single column matches another row exactly. If you want to delete rows that are duplicates based on only one or two columns, uncheck the columns you do not care about. For example, if you have a list of customers and want to remove people with the same email address, uncheck all columns except Email.
Click OK and Excel removes the duplicate rows, then tells you how many rows were deleted. The remaining data shifts up to fill the gap. If you made a mistake, press Ctrl+Z immediately to undo. This method is fast for cleaning up large datasets but offers no way to review what will be deleted before it happens, so caution is warranted.
Checking for duplicates across two different columns
Sometimes you need to know whether a value in one column appears anywhere in a different column — for instance, checking if a customer ID in column A exists in column B. Use COUNTIF with a formula like =COUNTIF($B$2:$B$100,A2) in a helper column. A result of 0 means the value does not appear in column B; any number higher than 0 means it does.
You can also combine this with an IF statement to get a yes-or-no answer. Type =IF(COUNTIF($B$2:$B$100,A2)>0,"Found","Not Found") and copy it down. This is useful for reconciliation tasks, like checking whether an invoice number from one report appears in another.
Handling case sensitivity and extra spaces
By default, Excel treats "Smith" and "smith" as the same value when looking for duplicates. If you need to treat them as different, Conditional Formatting and Remove Duplicates do not have a built-in case-sensitive option. You would need to use a more complex formula approach or manually review the results.
Extra spaces are a common source of false duplicates. A cell containing "John " (with a trailing space) will not match "John" (without the space) in Conditional Formatting or Remove Duplicates, even though they look identical. Before running any duplicate check, use Find & Replace to clean up spaces. Press Ctrl+H, search for two spaces, replace with one space, and repeat until no more replacements occur. Then search for a single space at the start or end of cells if needed.
Frequently Asked Questions
Can I highlight duplicates in just one column while ignoring the others?
Yes. Select only the column you want to check for duplicates, then use Conditional Formatting > Highlight Cell Rules > Duplicate Values. Excel will only look at values in that column and ignore the rest of the spreadsheet.
What if I want to keep one copy of each duplicate and delete the rest?
Remove Duplicates deletes all but the first occurrence of each duplicate automatically. Select your data, go to Data > Remove Duplicates, make sure all relevant columns are checked, and click OK. The first row of each duplicate set stays; the rest are removed.
Does COUNTIF work with dates and times?
Yes, COUNTIF works with dates and times the same way it works with text and numbers. If you have dates in column A, the formula =COUNTIF($A$2:$A$100,A2) will count how many times each date appears. Be aware that times with different decimal precision (like 10:00:00 versus 10:00:00.5) may not match.
Can I undo Remove Duplicates if I delete the wrong rows?
Yes, but only immediately. Press Ctrl+Z right after the deletion to undo. If you close the file or perform other actions first, the undo history is lost. This is why making a copy before using Remove Duplicates is important.
How do I find duplicates in a filtered list?
Conditional Formatting and COUNTIF both work on filtered data, but they count all rows in the range, not just the visible ones. Remove Duplicates only affects visible rows. If you filter first and then use Remove Duplicates, only the duplicates in the filtered view will be deleted.