How To Filter Duplicate Values in Excel & Google Sheets

Written by

Editorial Team

Reviewed by

Steve Rynearson

Last updated on April 10, 2023

This tutorial demonstrates how to filter duplicate values in Excel and Google Sheets.

 

filter duplicate values 01

 

Advanced Filter to Hide Duplicate Values

  1. Click in the range where you wish to apply the filter to (any cell from B3 to B25).
  2. In the Ribbon, go to Data > Sort & Filter > Advanced.

 

filter duplicate values 02

 

  1. You can either filter the list in place, or you can put the results in a different range on your worksheet.

 

filter duplicate values 03

 

  1. Tick the Unique records only checkbox, and then click OK.

 

filter duplicate values 04

 

  1. The rows with duplicate values are hidden. Notice that the row numbers are now in blue and some of the rows do not appear.
  2. In the Ribbon, go to Data > Sort & Filter > Clear to remove the filter.

 

filter duplicate values 05

 

Filter Duplicate Values to a New Location

  1. Select the range you wish to filter (e.g., B4:B25).
  2. In the Ribbon, go to Data > Sort & Filter > Advanced.
  3. Choose Copy to another location.
  4. Select the new location range in the Copy to: box and tick the Unique records only checkbox.

 

filter duplicate values 06

 

This leaves you with the original list unchanged and a separate list of only unique values.

 

filter duplicate values 07

 

Filter Duplicates Rows

The sections above show how to filter duplicate values, and each example has just one column, but you can also filter when there are duplicate rows in a table. Apply the filter to the entire range, and hide any rows where all columns are identical.

 

filter duplicate values 08

 

  1. Click in the range you wish to apply the filter to (any cell from B3 to E11).
  2. In the Ribbon, select Data > Sort & Filter > Advanced.
  3. Filter the list in place and tick the option to show unique records only.
  4. Click OK.

 

filter duplicate values 09

 

Use COUNTIF to Filter Duplicates

To filter using the COUNTIF Function alongside standard filtering, first add a new helper column to your worksheet.

 

filter duplicate values 10

 

  1. Click in C4 and type in the formula:
=IF(COUNTIF($B$4:B4,B4)=1,1,0)
  1. Copy the formula down to Row 25.
  2. If the city appears more than once, a zero appears next to it when it appears for the second or subsequent time.

 

filter duplicate values 11

 

  1. In the Ribbon, go to Home > Filter.

 

filter duplicate values 12

 

  1. Filter buttons/arrows now appear in the heading row of your list.

 

filter duplicate values 13

 

  1. Click the filter arrow in the helper column and check 1 as the value to show.

 

filter duplicate values 14

 

Your list is now filtered to show only unique values.

 

filter duplicate values 15

 

Filter Duplicates in Google Sheets

Google Sheets does not have an advanced filter feature. You can filter duplicate values by using the same formula as you would use in Excel.

  1. Click in C4 and type in the formula:
=IF(COUNTIF($B$4:B4,B4)=1,1,0)
  1. Copy the formula down to Row 25.

 

filter duplicate values 16

 

  1. In the Menu, go to Data>Create Filter.

 

filter duplicate values 17

 

  1. Remove the tick from the 0 to exclude them and show only the 1s.

 

filter duplicate values 18

 

  1. Click OK to filter the list.

 

filter duplicate values 19

AI Formula Generator

Try for Free

See all How-To Articles