HOW TO Filter for unique values or remove duplicate values IN EXCEL

5 min


0
210 shares

ON WINDOWS

In Excel, there are several ways to filter for unique values—or remove duplicate values:

  • To filter for unique values, click Data > Sort & Filter > Advanced.
  • To remove duplicate values, click Data > Data Tools > Remove Duplicates.
  • To highlight unique or duplicate values, use the Conditional Formatting command in the Style group on the Home tab.

Learn about filtering for unique values or removing duplicate values

Filtering for unique values and removing duplicate values are two similar tasks, since the objective is to present a list of unique values. There is a critical difference, however: When you filter for unique values, the duplicate values are only hidden temporarily. However, removing duplicate values means that you are permanently deleting duplicate values.

A duplicate value is one in which all values in at least one row are identical to all of the values in another row. A comparison of duplicate values depends on the what appears in the cell—not the underlying 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.

Check before removing duplicates: Before removing duplicate values, it’s a good idea to first try to filter on—or conditionally format on—unique values to confirm that you achieve the results you expect.

Filter for unique values

Follow these steps:

  1. Select the range of cells, or ensure that the active cell is in a table.
  2. Click Data > Advanced (in the Sort & Filter group).
  3. In the Advanced Filter popup 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:

  • Click Copy to another location.
  • In the Copy to box, enter a cell reference.
  • Alternatively, click Collapse Dialog  to temporarily hide the popup window, select a cell on the worksheet, and then click Expand  .
  • Check the Unique records only, then click OK.

The unique values from the range will copy to the new location.

Remove duplicate values

When you remove duplicate values, the only effect is on the values in the range of cells or table. Other values outside the range of cells or table will not change or move.  When duplicates are removed, the first occurrence of the value in the list is kept, but other identical values are deleted. 

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.

Follow these steps:

  1. Select the range of cells, or ensure that the active cell is in a table.
  2. On the Data tab, click Remove Duplicates (in the Data Tools group).
  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.Note: Data will be removed from all columns, even if you don’t select all the columns at this step. For example, if you select Column1 and Column2, but not Column3, then the “key” used to find duplicates is the value of BOTH Column1 & Column2.  If a duplicate is found in those columns, then the entire row will be removed, including other columns in the table or range.
  4. Click OK, and a message will appear to indicate how many duplicate values were removed, or how many unique values remain. Click OK to dismiss this message.
  5. Undo the change by click Undo (or pressing Ctrl+Z on the keyboard).

Problems removing duplicates from outlined or subtotaled data

You cannot remove duplicate values from outline data that is outlined or that has subtotals. To remove duplicates, you must remove both the outline and the subtotals. For more information, see Outline a list of data in a worksheet and Remove subtotals.

Conditionally format unique or duplicate values

Note: You cannot conditionally format fields in the Values area of a PivotTable report by unique or duplicate values.

Quick formatting

Follow these steps:

  1. Select one or more cells in a range, table, or PivotTable report.
  2. On the Home tab, in the Style group, click the small arrow for Conditional Formatting, and then click Highlight Cells Rules, and select Duplicate Values.
  3. Enter the values that you want to use, and then choose a format.

Advanced formatting

Follow these steps:

  1. Select one or more cells in a range, table, or PivotTable report.
  2. On the Home tab, in the Styles group, click the arrow for Conditional Formatting, and then click Manage Rules to display the Conditional Formatting Rules Manager popup window.
  3. Do one of the following:
    • To add a conditional format, click New Rule to display the New Formatting Rule popup window.
    • To change a conditional format, begin by ensuring that the appropriate worksheet or table has been chosen in the Show formatting rules for list. If necessary, choose another range of cells by clicking Collapse  button in the Applies to popup window temporarily hide it. Choose a new range of cells on the worksheet, then expand the popup window again  . Select the rule, and then click Edit rule to display the Edit Formatting Rule popup window.
  4. Under Select a Rule Type, click Format only unique or duplicate values.
  5. In the Format all list of Edit the Rule Description, choose either unique or duplicate.
  6. Click Format to display the Format Cells popup window.
  7. Select the number, font, border, or fill format that you want to apply when the cell value satisfies the condition, and then click OK. You can choose more than one format. The formats that you select are displayed in the Preview panel.

ON WEB

In Excel for the web, you can remove duplicate values.

Remove duplicate values

When you remove duplicate values, the only effect is on the values in the range of cells or table. Other values outside the range of cells or table will not change or move. When duplicates are removed, the first occurrence of the value in the list is kept, but other identical values are deleted.

Important: You can always click Undo to get back your data after you have removed the duplicates. That being said, it’s a good idea to copy the original range of cells or table to another worksheet or workbook before removing duplicate values.

Follow these steps:

  1. Select the range of cells, or ensure that the active cell is in a table.
  2. On the Data tab, click Remove Duplicates .
  3. In the Remove Duplicates dialog box, unselect any columns where you don’t want to remove duplicate values.Note: Data will be removed from all columns, even if you don’t select all the columns at this step. For example, if you select Column1 and Column2, but not Column3, then the “key” used to find duplicates is the value of BOTH Column1 & Column2.  If a duplicate is found in Column1 and Column2, then the entire row will be removed, including data from Column3.
  4. Click OK, and a message will appear to indicate how many duplicate values were removed. Click OK to dismiss this message.

Note: If you want to get back your data, simply click Undo (or press Ctrl+Z on the keyboard).

Need more help?

You can always ask an expert in the Excel Tech Community, get support in the Answers community, or suggest a new feature or improvement on Excel User Voice.


Like it? Share with your friends!

0
210 shares
Sande Kennedy

Sande Kennedy is the founder and Editor in Chief of SandeKennedy.com & Kenyans247.com He is a Kenyan-based Internetprenuer,blogger Political Activist & informer who has an interest in politics, governance, corporate-fraud and human-interest. Kindly drop me a note if you feel aggrieved on any matter that you would want to be highlighted  Twitter: @itssandekennedy , Instagram: @itssandekennedy WhatsApp: +254791890826 Read More about me here
Open chat
1
Would you like to get published on this Popular Blog? You can now email Sande Kennedy any breaking news, Exposes, story ideas, human interest articles or interesting videos on: info@sandekennedy.com. Videos and pictures can be sent to +254 791890826 here on WhatsApp by clicking this send button
Powered by