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 shade every duplicate cell in that range with a color you choose.

If you need to see which values appear more than once without highlighting, you can use a formula instead. The COUNTIF function counts how many times each value appears in a range, and you can add a helper column to flag duplicates for review.

For larger datasets or when you need to remove duplicates entirely, Excel's Remove Duplicates feature deletes extra rows in one step. Each method works best for different situations depending on what you plan to do with the duplicates once you find them.

Key Takeaways

  • Conditional Formatting is the quickest visual way to spot duplicates — select your data, go to Home > Conditional Formatting > Highlight Cell Rules > Duplicate Values.
  • COUNTIF formulas let you count how many times each value appears and flag duplicates in a separate column without changing your original data.
  • The Remove Duplicates feature (Data tab) deletes extra rows permanently, so use it only when you are certain you want to remove them.
  • For very large datasets, filtering by the helper column or sorting by duplicate count makes it easier to review and decide what to keep.

Using Conditional Formatting to highlight duplicates

Conditional Formatting is the simplest method for most people because it requires no formulas and works on any size range. Select the cells you want to check — click the first cell, hold Shift, and click the last cell in your range. If your data has headers, include them or exclude them depending on whether you want to flag a header as a duplicate.

With your range selected, click the Home tab at the top of the ribbon. Find the Conditional Formatting button (it looks like a paint bucket or highlight marker), click the dropdown arrow next to it, and select Highlight Cell Rules. A submenu appears with options including Duplicate Values. Click that option.

A dialog box opens asking what color you want duplicates to be. The default is light red fill with dark red text, but you can change it by clicking the dropdown. Click OK, and Excel shades every cell in your range that contains a value appearing more than once. The original data stays unchanged — this is purely visual.

Finding duplicates with COUNTIF formulas

If you want to keep your original data untouched and see exactly how many times each value repeats, use a COUNTIF formula in a helper column. This method also lets you sort or filter by the count, making it easy to find the most common duplicates first.

Click the first empty column next to your data. In the top cell of that column, type =COUNTIF($A$2:$A$100,A2) — replace A2:A100 with your actual data range, and replace the second A2 with the cell you are checking. The dollar signs lock the range so it does not change when you copy the formula down. Press Enter.

Excel shows a number — how many times that value appears in your range. Copy this formula down to every row with data by clicking the cell, copying it (Ctrl+C), selecting the range below, and pasting (Ctrl+V). Now every row shows its count. Any value with a count higher than 1 is a duplicate. You can sort by this column to group duplicates together, or filter to show only values that appear more than once.

Removing duplicates permanently

Excel's Remove Duplicates feature deletes extra rows in one action, keeping only the first occurrence of each value. This is permanent and cannot be undone with Undo if you close the file, so save a backup copy first.

Select your entire data range including headers. Click the Data tab, then find the Remove Duplicates button (it may be under Data Tools or a dropdown menu depending on your Excel version). A dialog box lists all your columns. By default, all columns are checked, meaning Excel looks at the entire row to decide if it is a duplicate. If you want to check only certain columns, uncheck the others. Click OK.

Excel removes every row where all checked columns match a row above it, keeping the first occurrence. A message tells you how many rows were deleted. If the result is wrong, press Ctrl+Z immediately to undo. If you closed the file, you will need to use your backup copy.

Filtering to review duplicates before deleting

Before using Remove Duplicates, you can filter your data to see only the duplicates and decide which ones to keep manually. This gives you more control than the automatic removal.

First, add a helper column with COUNTIF as described above. Click any cell in your data range, then click the Data tab and select AutoFilter. Dropdown arrows appear in your header row. Click the dropdown in your helper column and select only values greater than 1. Now only rows with duplicates show on screen.

Review the filtered list and delete the rows you do not want to keep by right-clicking the row number and selecting Delete. When you are done, click the Data tab again and turn off AutoFilter to see all remaining rows. Delete the helper column if you no longer need it.

Finding duplicates across multiple columns

Sometimes you need to find duplicates based on a combination of columns rather than a single column. For example, you might want to flag rows where both the first name and last name match, even if the email is different.

Create a helper column and use COUNTIFS instead of COUNTIF. Type =COUNTIFS($A$2:$A$100,A2,$B$2:$B$100,B2) — this counts rows where column A matches A2 AND column B matches B2. Adjust the column letters and range to match your data. Copy this formula down, and any row with a count higher than 1 is a duplicate based on those two columns.

You can add as many columns as you need to the COUNTIFS formula. Each pair of ranges and criteria checks another column, so =COUNTIFS($A$2:$A$100,A2,$B$2:$B$100,B2,$C$2:$C$100,C2) checks three columns at once.

Handling duplicates in very large datasets

For datasets with thousands of rows, Conditional Formatting can slow down your file because Excel recalculates the formatting every time you make a change. COUNTIF formulas are faster, but sorting and filtering the results is still the quickest way to review them.

Add a COUNTIF helper column, then sort your entire dataset by that column in descending order. All the duplicates (count greater than 1) move to the top, grouped by how many times they appear. This makes it easy to scan and decide what to do with them. When you are done reviewing, you can delete the helper column or keep it for future reference.

If your file is extremely large and slowing down, consider splitting it into smaller ranges, checking each range separately, or using Excel's built-in data analysis tools like Pivot Tables to summarize which values repeat most often.

Frequently Asked Questions

Can I find duplicates in just one column without checking the whole row?

Yes. Select only that column, then use Conditional Formatting > Highlight Cell Rules > Duplicate Values. Or use COUNTIF with just that column's range. If you use Remove Duplicates, uncheck all other columns in the dialog so Excel only compares the selected column.

What if I want to keep the last duplicate instead of the first?

Remove Duplicates always keeps the first occurrence. To keep the last, sort your data in reverse order first, run Remove Duplicates, then sort back to your preferred order. Or manually delete the rows you do not want to keep using the filter method described above.

Does Conditional Formatting work on dates and numbers the same way as text?

Yes. Conditional Formatting treats dates, numbers, and text the same way — it flags any value that appears more than once in your range. COUNTIF and Remove Duplicates also work on all data types without any difference in how you set them up.

Can I undo Remove Duplicates if I change my mind?

Only if you have not closed the file — press Ctrl+Z immediately. Once you close and reopen the file, the deletion is permanent. Always save a backup copy before using Remove Duplicates on data you care about.

How do I find duplicates between two different sheets?

Create a helper column in one sheet with COUNTIF that references the other sheet. Type =COUNTIF(Sheet2!$A$2:$A$100,A2) to count how many times each value in Sheet1 appears in Sheet2. A count of zero means it is unique to Sheet1; any higher count means it appears in both sheets.