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 the 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 "3/8/2006" and the other as "Mar 8, 2006", the values are unique.

It's a good idea to filter for unique values first to confirm that the results are what you want before removing duplicate values.What do you want to do?



Filter for unique values

  1. Select the range of cells, or make sure the active cell is in a table.
  2. On the Data tab, in the Sort & Filter group, click Advanced.

    outlook ribbon image

  3. In the Advanced Filter dialog box, do one of the following:
    1. To filter the range of cells or table in place, click Filter the list, in-place.
    2. To copy the results of the filter to another location, do the following:
      1. Click Copy to another location.
      2. In the Copy to box, enter a cell reference.

        Alternatively, click Collapse Dialog button image to temporarily hide the dialog box, select a cell on the worksheet, and then press Expand Dialog button image.

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

    The unique values from the selected range are copied to the new location.

Remove duplicate values

When you remove duplicate values, only the values in the range of cells or table are affected. Any other values outside the range of cells or table are not altered or moved.

Caution Because you are permanently deleting data, it's a good idea to copy the original range of cells or table to another worksheet or workbook before removing duplicate 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 Data Tools group, click Remove Duplicates.

    excel ribbon image

  3. Do one or more of the following:
    • Under Columns, select one or more columns.
    • To quickly select all columns, click Select All.
    • To quickly clear all columns, click Unselect All.

      If the range of cells or table contains many columns and you want to only select a few columns, you may find it easier to click Unselect All, and then under Columns, select those columns.

  4. Click OK.

    A message is displayed indicating how many duplicate values were removed and how many unique values remain, or if no duplicate values were removed.

  5. Click OK.

See also: