For each of the methods described below, we use the simple spreadsheet below, which has a list of names in column A.
We first show how to use Excel's Remove Duplicates command to remove duplicates, and then we show how to use Excel's Advanced Filter to accomplish this task. Finally, we show how to remove duplicates using the function Countif
of Excel .
The command Remove duplicates it is found in the “Data Tools” group, inside the tab Data of the Excel ribbon.
To remove duplicate cells using this command:
Note that Excel's Remove Duplicates command can also be used on datasets with multiple columns. An example of this is provided on the Remove Duplicate Rows page.
Excel's Advanced Filter has an option that lets you filter unique records in a spreadsheet and copy the resulting filtered list to a new location.
This provides a list that contains the first occurrence of a duplicate record, but contains no further occurrences.
To remove duplicates using the advanced filter:
The resulting spreadsheet, with the new list of data in column C, is shown above.
You may notice that the duplicate value “Dan BROWN” has been removed from the list.
You can now delete the columns to the left of your new data list (columns AB in the example spreadsheet) to return to the original spreadsheet format.
This method will only work if the cell contents are less than 256 characters in length, as Excel functions cannot handle longer text strings.
Another way to remove duplicates in a range of Excel cells is to use the function Countif
of Excel .
To illustrate this, we will once again use the simple example spreadsheet, which has a list of names in column A.
To find any duplicates in the list of names, we insert the function Countif
in column B of the spreadsheet (see below). This function shows the number of occurrences of each name up to the current line.
As shown in the spreadsheet formula bar above, the format of the function Countif in cell B2 it is :=COUNTIF( $A$2:$A$11, A2 )
Please note that this feature uses a combination of absolute and relative cell references. Because of this combination of reference styles, when the formula is copied into column B, it becomes,
=COUNTIF( $A$2:$A$11, A2 ) =COUNTIF( $A$2:$A$11, A3 ) =COUNTIF( $A$2:$A$11, A4 ) etc. |
Therefore, the formula in cell B4 returns the value 1 for the first occurrence of the text string “Laura BROWN,” but the formula in cell B7 returns the value 1 for the second occurrence of this text string.
Now that we have used the Excel function Countif
To highlight duplicates in column A of the example spreadsheet, we need to delete the rows for which the count is greater than 1.
In the simple example spreadsheet, it is easy to see and delete the single duplicate row. However, if you have multiple duplicates, you may find it quicker to use Excel's automatic filter to delete all duplicate rows at once. Use Excel's automatic filter to eliminate duplicate rows
The following steps show how to remove multiple duplicates at once (after they have been highlighted using the function Countif
):
Countif
(column B in the example spreadsheet);Countif
to return to the original spreadsheet format.Ercole Palmeri
Developing fine motor skills through coloring prepares children for more complex skills like writing. To color…
The naval sector is a true global economic power, which has navigated towards a 150 billion market...
Last Monday, the Financial Times announced a deal with OpenAI. FT licenses its world-class journalism…
Millions of people pay for streaming services, paying monthly subscription fees. It is common opinion that you…