How to Remove Both Duplicate Rows by Formula in Excel

If you want to remove duplicate data from a list you can use Remove Duplicates function in excel directly, then the unique data will be saved in the list, the duplicate one will be removed. But if you want to remove both duplicates from your list, this function cannot help you. In this article, I will introduce you a simple way to solve this problem.

See the example below. A name list with some duplicate names.

Original List:                                         Updated List after Remove Duplicates:

Remove Both Duplicate Rows 1                                    Remove Both Duplicate Rows 2

If you want to remove both duplicate values like ‘Amy’ ‘Cathy’, you can follow below steps.

Remove Both Duplicate Rows by Formula


Step 1: In cell B2 enter the formula =IF(COUNTIF($A$2:$A$9,A2)=1,0,1). In this formula we use IF and COUNTIF functions together. COUNTIF function is used for counting the number of A2 from range $A$2:$A$9, and IF function is used for returning True of False value. For example, A2 value Ada only appears once in the list, so COUNTIF($A$2:$A$9,A2) will return 1 (so COUNTIF($A$2:$A$9,A2)=1 is true), so IF function will return 0 in B2.

Remove Both Duplicate Rows 3

Step 2: Drag the fill handle down to fill the other cells. So B2 to B9 will be filled by this formula. Due to some values are duplicate in the list, you can see for some values IF function returns 0, and for the others returns 1.

Remove Both Duplicate Rows 4

Step 3: We can see that for the duplicate values, they are marked with 1 in B column. So we can use filter function in B column to filter them out. Select on B1, click Data->Filter.

Remove Both Duplicate Rows 5

Step 4: Click dropdown list arrow button, only check on value 1 in the list. Then click OK button.

Remove Both Duplicate Rows 6

Step 5: Verify that all duplicate values are listed.

Remove Both Duplicate Rows 7

Step 6: Then you can remove row 3,4,5,8 now. Press Ctrl and select on row 3,4,5,8.

Remove Both Duplicate Rows 8

Step 7: Right click and select ‘Delete Row’. Verify that these duplicate rows are removed.

Remove Both Duplicate Rows 9

Remove Both Duplicate Rows 10

Step 8: Remove filter, delete value in column B. Then we get the updated list without duplicate values.

Remove Both Duplicate Rows 11

 

Related Posts

Match Single Criteria in Excel

No repeat statistic based on a single condition is used wildly in daily work, for example, count type of products, the duplicate types are not encountered. This article describes the way of no repeats statistics for data in a single ...

Excel Array Construction

This article will talk about how to create one-dimensional array or two-dimensional array by using some functions in Excel. When using array formulas in Excel, we often use functions to construct arrays. Generate Array with ROW or COLUMN Functions Array ...

Excel Array Operation

We have all heard of arrays. Depending on the dimensionality, they are divided into one-dimensional arrays and two-dimensional arrays. Depending on the data type, they can also be divided into numeric arrays, logical arrays, and so on. The concatenation and ...

Excel Array Matrix Operation

In Excel, we have a built-in function used to perform matrix operations. It is the MMULT function. This function accepts two arrays as parameters and returns the product of the two arrays. However, this function has a prerequisite that the ...

A1 Reference Style and R1C2 Reference in Excel

In Excel, there are two reference styles. A1 reference style and R1C2 reference style. These two reference styles can help us find the cell by the cell address. Some functions return these two addresses through the argument settings. A1 Reference ...

Sidebar