Filter for or remove duplicate values (2023)

Filtering for unique values and removing duplicate values are two closely related tasks because the displayed results are the same — a list of unique values. The difference, however, is important. When you filter for unique values, you temporarily hide duplicate values, but when you remove duplicate values, you permanently delete duplicate values. A duplicate value is one where all values in the row are an exact match of all values in another row. Duplicate values are determined by the value displayed in the cell and not necessarily the value stored in the cell. For example, if you have the same date value in different cells, one formatted as "12/8/2017" and the other as "Dec 8, 2017", the values are unique. It's a good idea to filter for or conditionally format unique values first to confirm that the results are what you want before removing duplicate values.

Note:If the formula in the cells is different, but the values are the same, they are considered duplicates. For example, if cell A1 contains the formula =2-1 and cell A2 contains the formula =3-2, as long as the value is formatted the same, they are considered to be duplicate values. If the same value is formatted using different number formats, they are not considered duplicates. For example, if the value in cell A1 is formatted as 1.00 and the value in cell A2 is formatted as 1, they are not considered duplicates.

Newer versionsOffice 2011

Filter for unique values

  1. Select the range of cells, or make sure that the active cell is in a table.

  2. On the Data tab, in the Sort & Filter group, click Advanced.

    Filter for or remove duplicate values (1)

  3. Do one of the following:

    To

    Do this

    Filter the range of cells or table in place

    Select the range of cells, and then click Filter the list, in-place.

    Copy the results of the filter to another location

    Select the range of cells, click Copy to another location, and then in the Copy to box, enter a cell reference.

    Note:If you copy the results of the filter to another location, the unique values from the selected range are copied to the new location. The original data is not affected.

  4. Select the Unique records only check box, and then click OK.

More options

When you remove duplicate values, only the values in the selected range of cells or table are affected. Any other values outside the range of cells or table are not altered or moved. Because you are permanently deleting data, it's a good idea to copy the original range of cells or table to another sheet or workbook before removing duplicate values.

Note:You cannot remove duplicate values from data that is outlined or that has subtotals. To remove duplicates, you must remove both the outline and the subtotals first.

  1. Select the range of cells, or make sure that the active cell is in a table.

    (Video) Filter for Duplicates with Conditional Formatting

  2. On the Data tab, in the Data Tools group, click Remove Duplicates.

    Filter for or remove duplicate values (2)

  3. Select one or more of the check boxes, which refer to columns in the table, and then click Remove Duplicates.

    Tip:If the range of cells or table contains many columns and you want to only select a few columns, clear the Select All check box and select only the columns that you want.

You can apply conditional formatting to unique or duplicate values so that they can be seen easily. Color coding duplicate data, for example, can help you locate and, if necessary, remove that data.

  1. Select one or more cells in a range, table, or PivotTable report.

  2. On the Home tab, in the Styles group, click Conditional Formatting, point to Highlight Cells Rules, and then click Duplicate Values.

  3. Select the options that you want in the New Formatting Rule dialog box, and then click OK.

You can create a rule to color code unique or duplicate data in your sheet. This is especially helpful when your data includes multiple sets of duplicate values.

  1. Select one or more cells in a range, table, or PivotTable report.

  2. On the Home tab, in the Styles group, click Conditional Formatting, and then click New Rule.

  3. In the Style list, choose Classic, and then in the Format only top or bottom ranked values list, choose Format only unique or duplicate values.

  4. In the values in the selected range list, choose either unique or duplicate.

  5. In the Format with list, select an option for how you want the unique or duplicate values to be formatted.

    (Video) How To: Filter Duplicate Values in Excel

You can edit an existing rule and modify it to apply conditional formatting to unique or duplicate data.

  1. Select one or more cells in a range, table, or PivotTable report.

  2. On the Home tab, in the Styles group, click Conditional Formatting, and then click Manage Rules.

  3. Make sure that the appropriate sheet or table is selected in the Show formatting rules for list.

  4. Select the rule, and then click Edit Rule.

  5. Select the options that you want, and then click OK.

Filter for unique values

  1. Select the range of cells, or make sure that the active cell is in a table.

  2. On the Data tab, under Sort & Filter, click the arrow next to Filter, and then click Advanced Filter.

    Filter for or remove duplicate values (3)

  3. Do one of the following:

    To

    Do this

    Filter the range of cells or table in place

    Select the range of cells, and then click Filter the list, in-place.

    Copy the results of the filter to another location

    Select the range of cells, click Copy to another location, and then in the Copy to box, enter a cell reference.

    Note:If you copy the results of the filter to another location, the unique values from the selected range are copied to the new location. The original data is not affected.

  4. Select the Unique records only check box, and then click OK.

More options

When you remove duplicate values, only the values in the selected range of cells or table are affected. Any other values outside the range of cells or table are not altered or moved. Because you are permanently deleting data, it's a good idea to copy the original range of cells or table to another sheet or workbook before removing duplicate values.

Note:You cannot remove duplicate values from data that is outlined or that has subtotals. To remove duplicates, you must remove both the outline and the subtotals first.

(Video) 3 EASY Ways to Find and Remove Duplicates in Excel

  1. Select the range of cells, or make sure that the active cell is in a table.

  2. On the Data tab, under Tools, click Remove Duplicates.

    Filter for or remove duplicate values (4)

  3. Select one or more of the check boxes, which refer to columns in the table, and then click Remove Duplicates.

    Excel displays either a message indicating how many duplicate values were removed and how many unique values remain, or a message indicating that no duplicate values were removed.

    Tip:If the range of cells or table contains many columns and you want to only select a few columns, clear the Select All check box and select only the columns that you want.

You can apply conditional formatting to unique or duplicate values so that they can be seen easily. Color coding duplicate data, for example, can help you locate and, if necessary, remove that data.

  1. Select one or more cells in a range, table, or PivotTable report.

  2. On the Home tab, under Format, click the arrow next to Conditional Formatting, point to Highlight Cells Rules, and then click Duplicate Values.

    Filter for or remove duplicate values (5)

  3. Select the options that you want, and then click OK.

You can create a rule to color code unique or duplicate data in your sheet. This is especially helpful when your data includes multiple sets of duplicate values.

  1. Select one or more cells in a range, table, or PivotTable report.

  2. On the Home tab, under Format, click the arrow next to Conditional Formatting, and then click New Rule.

    (Video) Filter Duplicate Values in Excel Without Removing Them

    Filter for or remove duplicate values (6)

  3. On the Style pop-up menu, click Classic, and then on the Format only top or bottom ranked values pop-up menu, click Format only unique or duplicate values.

  4. On the values in the selected range pop-up menu, click either unique or duplicate.

  5. On the Format with pop-up menu, select an option for how you want the unique or duplicate values to be formatted.

You can edit an existing rule and modify it to apply conditional formatting to unique or duplicate data.

  1. Select one or more cells in a range, table, or PivotTable report.

  2. On the Home tab, under Format, click the arrow next to Conditional Formatting, and then click Manage Rules.

    Filter for or remove duplicate values (7)

  3. Make sure that the appropriate sheet or table is selected on the Show formatting rules for pop-up menu.

  4. Select the rule, and then click Edit Rule.

  5. Select the options that you want, and then click OK.

See also

Sort a list of data

Filter a list of data

Filter by font color, cell color, or icon sets

Find and replace text or numbers

Videos

1. Remove duplicate values using advanced filters 🤯
(Excel Quick Tips)
2. How to Remove Duplicates in Microsoft Excel
(Cody Baldwin)
3. Google Sheets: How to Filter & Remove Duplicates [Using Formulas & Conditional Formatting]
(Excel, Word and PowerPoint Tutorials from Howtech)
4. Excel How to Filter Duplicate Values in Excel
(ExcelHow Tech)
5. Remove duplicate from array using filter method || Filter Method || IndexOf Method || Javscript
(Creative Developer)
6. How to Remove Duplicates in Excel
(Kevin Stratvert)
Top Articles
Latest Posts
Article information

Author: Nathanial Hackett

Last Updated: 03/18/2023

Views: 6127

Rating: 4.1 / 5 (72 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Nathanial Hackett

Birthday: 1997-10-09

Address: Apt. 935 264 Abshire Canyon, South Nerissachester, NM 01800

Phone: +9752624861224

Job: Forward Technology Assistant

Hobby: Listening to music, Shopping, Vacation, Baton twirling, Flower arranging, Blacksmithing, Do it yourself

Introduction: My name is Nathanial Hackett, I am a lovely, curious, smiling, lively, thoughtful, courageous, lively person who loves writing and wants to share my knowledge and understanding with you.