Filter for unique values or remove duplicate values
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
- Select the range of cells, or make sure the active cell is in a table.
- On the
Datatab, in theSort & Filtergroup, clickAdvanced.
- In the
Advanced Filterdialog box, do one of the following:- To filter the range of cells or table in place, click
Filter the list, in-place. - To copy the results of the filter to another location, do the following:
- Click
Copy to another location. - In the
Copy tobox, enter a cell reference.Alternatively, click
Collapse Dialog
to temporarily hide the dialog box, select a cell on the worksheet, and then press Expand Dialog
.
- Click
- To filter the range of cells or table in place, click
- Select the
Unique records onlycheck box, and clickOK.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.
- Select the range of cells, or make sure that the active cell is in a table.
- On the
Datatab, in theData Toolsgroup, clickRemove Duplicates.
- 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 underColumns, select those columns.
- Under
- 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.
- Click
OK.