The fastest way to spot duplicates in Excel

Excel has a built-in tool called Conditional Formatting that highlights duplicate values automatically. Select the range of cells you want to check, go to the Home tab, click Conditional Formatting, choose Highlight Cell Rules, then select Duplicate Values. Excel will color every duplicate entry in that range so you can see them at a glance.

If you need a list of only the duplicates rather than highlighted cells, use the COUNTIF function to count how many times each value appears. Add a helper column next to your data, type =COUNTIF($A$2:$A$100,A2)>1 (adjusting the range to match your data), and copy the formula down. Any cell showing TRUE contains a duplicate value.

For larger datasets or when you need more control, 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 check, and Excel removes the extra copies, keeping only the first occurrence of each value.

Key Takeaways

  • Conditional Formatting highlights all duplicates in a selected range with color, making them visible without changing your data.
  • The COUNTIF function identifies duplicates by counting occurrences and marking rows where a value appears more than once.
  • Remove Duplicates permanently deletes extra copies of values, keeping only the first instance of each entry.
  • For checking duplicates across two different columns or sheets, use COUNTIF with a different range or combine it with VLOOKUP.

Using Conditional Formatting to highlight duplicates

Conditional Formatting is the simplest method for spotting duplicates without changing your spreadsheet. Select the cells you want to check — click the first cell, hold Shift, and click the last cell in your range. If your data is in column A from row 2 to row 50, select A2:A50.

On the Home tab, click the Conditional Formatting button (it looks like a paint bucket). A menu appears. Click Highlight Cell Rules, then Duplicate Values. Excel opens a dialog showing the color it will use — usually light red. Click OK, and every duplicate value in your selection turns that color. The original entry stays unhighlighted; only the copies get marked.

To remove the highlighting later, select the same range again, go to Conditional Formatting, click Clear Rules, then choose Clear Rules from Selected Cells. The highlighting disappears but your data stays intact.

Finding duplicates with the COUNTIF function

COUNTIF counts how many times a value appears in a range, which lets you identify duplicates without highlighting. Create a helper column next to your data — if your values are in column A, use column B for the formula.

In cell B2, type =COUNTIF($A$2:$A$100,A2)>1. The dollar signs lock the range so it does not change when you copy the formula down. The formula returns TRUE if the value in A2 appears more than once in the range, and FALSE if it appears only once. Copy this formula down to match all your data rows.

Now column B shows TRUE next to every duplicate value and FALSE next to unique values. You can sort by column B to group all duplicates together, or filter to show only the TRUE rows. If you want to delete the helper column later, right-click the column header and select Delete.

Removing duplicate rows entirely

If your goal is to clean up your data by deleting duplicate rows, use the Remove Duplicates feature. This works best when you have multiple columns and want to remove rows where all columns match, or where specific columns match.

Select your entire data range including headers. Go to the Data tab and click Remove Duplicates. A dialog appears listing all your columns with checkboxes. Check the columns you want Excel to use for comparison — if you want to remove rows only when columns A and B both match, check only those two. Click OK, and Excel removes duplicate rows, keeping the first occurrence of each combination.

Excel shows a message telling you how many duplicate rows it removed. This action cannot be undone with Ctrl+Z after you close the file, so consider making a copy of your spreadsheet first if you are unsure.

Checking for duplicates across two columns

Sometimes you need to find values in one column that also appear in another column — for example, checking whether customer IDs in column A exist in column B. Use COUNTIF with a different range.

In a helper column, type =COUNTIF($B$2:$B$100,A2)>0. This returns TRUE if the value from A2 appears anywhere in column B. Copy the formula down for all rows in column A. Any TRUE result means that value exists in both columns.

To find values that appear in column A but NOT in column B, use =COUNTIF($B$2:$B$100,A2)=0 instead. This is useful for finding missing records or items that have been removed from a list.

Checking for duplicates across multiple sheets

If your data is split across different sheets, you can still find duplicates by referencing another sheet in your formula. In a helper column on Sheet1, type =COUNTIF(Sheet2!$A$2:$A$100,A2)>0. Replace Sheet2 with the actual name of your other sheet, and adjust the range to match your data.

This formula returns TRUE if the value in Sheet1 column A appears anywhere in Sheet2 column A. You can use the same approach to compare data across three or more sheets by adding multiple COUNTIF formulas in different helper columns.

Handling duplicates with spaces or formatting differences

Sometimes values look identical but are not — extra spaces, different capitalization, or different number formats can make Excel treat them as separate entries. The TRIM function removes leading and trailing spaces, and UPPER converts text to uppercase for comparison.

In a helper column, type =COUNTIF($A$2:$A$100,TRIM(UPPER(A2)))>1. This removes spaces and converts to uppercase before counting, so "John " and "john" are treated as the same value. If you want to keep your original data unchanged, create a separate column with cleaned values using =TRIM(UPPER(A2)), then run COUNTIF on that cleaned column instead.

Frequently Asked Questions

Does Conditional Formatting remove duplicates or just highlight them?

Conditional Formatting only highlights duplicates with color — it does not change or delete any data. If you want to remove duplicates, use the Remove Duplicates feature on the Data tab instead.

What is the difference between Remove Duplicates and Conditional Formatting?

Conditional Formatting marks duplicates with color so you can see them and decide what to do. Remove Duplicates permanently deletes duplicate rows. Use Conditional Formatting to review first, then Remove Duplicates if you want to clean up your data.

Can I check for duplicates in just one column while ignoring other columns?

Yes. Select only the column you want to check, then apply Conditional Formatting or COUNTIF to just that column. If using Remove Duplicates, uncheck all columns except the one you want to compare on.

What happens if I use Remove Duplicates and then close Excel without saving?

If you close without saving, your data returns to its original state with duplicates still present. If you save after removing duplicates, the deleted rows are gone permanently. Always save a backup copy before using Remove Duplicates if you are unsure.

How do I find duplicates when the values have extra spaces or different capitalization?

Use TRIM and UPPER functions in your COUNTIF formula to ignore spacing and capitalization differences. Type =COUNTIF($A$2:$A$100,TRIM(UPPER(A2)))>1 to treat "John " and "john" as the same value.