Filtering for Duplicates in Excel: 4 Fast Ways

How-to basics · Updated November 23, 2026

To filter for duplicates in Excel, the fastest method is to use Conditional Formatting to highlight duplicate values, then filter by cell color. Alternatively, use the Remove Duplicates command (Data > Remove Duplicates) to permanently delete duplicates, or use the UNIQUE function to extract a list of distinct values. This article covers all these methods, plus how to filter duplicates in Excel for the web and Mac.

Why Filtering Duplicates Matters

Duplicate data is one of the most common problems in spreadsheets. A duplicated customer ID can double-count revenue; a repeated email address can cause a mail merge to send two messages; a repeated product SKU can corrupt an inventory count. Filtering duplicates—as opposed to permanently deleting them—is useful when you want to see the duplicates first, review them, or copy them elsewhere before making any changes. Excel gives you several distinct tools for this, and the right one depends on whether you want to view, count, or remove the duplicates.

Method 1: Conditional Formatting to Highlight and Filter Duplicates

This is the most visual approach and works for both single columns and multiple columns. It does not delete anything—it just colors the duplicate cells so you can filter them.

  1. Select the range of cells you want to check (for example, A2:A100).
  2. Go to Home > Conditional Formatting > Highlight Cells Rules > Duplicate Values.
  3. In the dialog, choose a format (the default is Light Red Fill with Dark Red Text). Click OK.
  4. Now, with the range still selected, click the Filter button on the Data tab (or press Ctrl+Shift+L on Windows, Cmd+Shift+L on Mac).
  5. Click the drop-down arrow in the column header, then choose Filter by Color and select the red fill color you just applied.

Now only the cells that had duplicates are visible. To see all rows again, clear the filter. This method is ideal when you want to review duplicates before acting on them.

Method 2: Remove Duplicates (Permanent Deletion)

If you are certain you want to delete duplicate rows, use the built-in Remove Duplicates command. This is destructive—it permanently deletes rows, so always save a copy of your workbook first.

  1. Select any cell inside your data range (Excel will auto-detect the range).
  2. Go to Data > Remove Duplicates.
  3. In the dialog, check which columns you want to consider for duplication. For example, if you select only “Email”, Excel will remove rows where the email is the same, even if other columns differ. If you select all columns, only fully identical rows are removed.
  4. Click OK. Excel will tell you how many duplicates were removed and how many unique values remain.

Note: This method keeps the first occurrence and removes later ones. It cannot be undone with Ctrl+Z if you close the file, so always work on a copy.

Method 3: UNIQUE Function to Extract Distinct Values

If you want to create a new list of unique values without altering your original data, use the UNIQUE function. This is available in Excel 2021 and Microsoft 365.

Example: with names in A2:A20, put this formula in C2:

=UNIQUE(A2:A20)

This spills the unique values down column C. To get unique rows across multiple columns (e.g., first name in A, last name in B), use:

=UNIQUE(A2:B20)

To count how many unique values exist, wrap it in COUNTA:

=COUNTA(UNIQUE(A2:A20))

This returns the number of distinct entries. Note that UNIQUE is dynamic—if you change the source data, the list updates automatically.

Method 4: Advanced Filter for Unique Records Only

The Advanced Filter is an older but powerful tool that can copy unique rows to another location without deleting anything.

  1. Select your data range.
  2. Go to Data > Advanced (in the Sort & Filter group).
  3. In the dialog, choose Copy to another location.
  4. Set the List range to your data (already selected).
  5. Set the Copy to box to an empty cell (e.g., E1).
  6. Check Unique records only.
  7. Click OK.

Excel copies only unique rows to the new location. This is a one-time snapshot—it does not update if the source changes.

How to Filter Duplicates in Excel for the Web and Mac

Excel for the web (browser) supports Conditional Formatting and Remove Duplicates, but the UNIQUE function is also available if you are using Microsoft 365. The ribbon paths are the same, but some keyboard shortcuts differ. On Mac, the Filter shortcut is Cmd+Shift+L instead of Ctrl+Shift+L. The Advanced Filter is not available in Excel for the web—you must use the desktop version for that. On Mac, the Advanced Filter is under Data > Advanced as well, but the dialog looks slightly different.

Common Problems and Misconceptions

“Why does Remove Duplicates leave some duplicates?” Because you may have selected only some columns. If you select only Column A, Excel considers rows duplicates if Column A matches, regardless of other columns. To remove fully identical rows, select all columns.

“Conditional Formatting highlights unique values instead of duplicates?” That happens if you choose “Unique” in the Duplicate Values dialog—it’s a toggle. Ensure “Duplicate” is selected.

“My data has blank cells—will they be treated as duplicates?” Yes, blank cells are considered duplicates. If you have multiple blank rows, they will be highlighted and removed. To avoid this, filter out blanks first or use a helper column.

“Can I filter duplicates based on a case-sensitive match?” By default, Excel is case-insensitive, so “Apple” and “apple” are considered the same. To do case-sensitive duplicate detection, you would need a helper column with a formula like =EXACT(A2,A3) and then filter on that, but this is more advanced.

Comparing the Methods: Which One Should You Use?

  • View duplicates without deleting: Use Conditional Formatting + Filter by Color.
  • Permanently delete duplicates: Use Remove Duplicates (on a copy of your data).
  • Create a dynamic unique list: Use UNIQUE function.
  • Copy unique rows to a new location without formulas: Use Advanced Filter.

For most users, Conditional Formatting is the safest starting point because it is non-destructive. If you need to clean a mailing list permanently, Remove Duplicates is faster, but always keep a backup.

Frequently Asked Questions

How do I count duplicates in Excel without deleting them?
Use a formula like =COUNTIF(A:A,A2) in a helper column to count how many times each value appears. Then filter the helper column for numbers greater than 1 to see duplicates.

Can I filter duplicates across two columns, like first and last name?
Yes. In Conditional Formatting, select both columns before applying Duplicate Values—Excel will treat the combination as a single value. For Remove Duplicates, check both columns in the dialog. For UNIQUE, use =UNIQUE(A2:B20).

Does Remove Duplicates work on filtered data?
No. Remove Duplicates ignores any filter and works on the entire data range. If you only want to remove duplicates from visible rows, you must copy the visible rows to a new sheet first, then run Remove Duplicates.

Why is my UNIQUE function returning a #SPILL! error?
The UNIQUE function needs empty cells below the formula to spill its results. If there is any data in those cells, you get #SPILL!. Clear the cells below or move the formula to a column with empty space.

Can I filter duplicates in Google Sheets the same way?
Google Sheets has a similar feature: Data > Data cleanup > Remove duplicates, and a UNIQUE function that works identically. Conditional Formatting is under Format > Conditional formatting, but the “Duplicate values” preset is not built-in—you would use a custom formula like =COUNTIF(A:A,A1)>1.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.