How to Compare Two Columns and Remove the Duplicate Values by Formula in Excel

To compare two columns and remove the duplicate values, we have already posted a tutorial about how to solve this problem by ‘Conditional Formatting’ feature ‘Remove Duplicate’ rule. Actually, there are some other ways to solve it as well. If you are not familiar with ‘Conditional Formatting’ feature, you can also use a formula to compare columns and remove the duplicate values. In this article, we will introduce you how to apply IF, ISERROR and MATCH functions in a formula to compare data, I hope after reading this article, you will find the way to resolve your problem.

Precondition:

See screenshot below. We prepare two lists with fruits. As the two lists are simple, so we can see ‘Apple’ exists in both two columns obviously. But if the list is very long, we cannot compare them easily, we need to use formula to compare them.

How to Compare Two Columns and Remove the Duplicate Values by Formula 1

Method: Compare Two Columns and Remove Duplicates by Formula


Step 1: In B2 which is just between two columns, enter the formula =IF(ISERROR(MATCH(A2,$C$2:$C$7,0)),”Not Duplicate”,”Duplicate”).

How to Compare Two Columns and Remove the Duplicate Values by Formula 2

Step 2: Press Enter to get value. Verify that we get ‘Duplicate’ in B2. That means ‘Apple’ in list1 also exists in list2.

How to Compare Two Columns and Remove the Duplicate Values by Formula 3

Step 3: Drag the fill handle down till the end of the list.

How to Compare Two Columns and Remove the Duplicate Values by Formula 4

Step 4: Now we already find out duplicate values, if you want to remove the duplicate value from list1, you can click B1, then click Data->Filter under Sort & Filter group.

How to Compare Two Columns and Remove the Duplicate Values by Formula 5

The filter dropdown list is created.

How to Compare Two Columns and Remove the Duplicate Values by Formula 6

Step 5: Click the small arrow button to load criteria, check on ‘Duplicate’, then click OK.

How to Compare Two Columns and Remove the Duplicate Values by Formula 7

Duplicate value in list1 is displayed.

How to Compare Two Columns and Remove the Duplicate Values by Formula 8

Step 6: Just remove duplicate value from filtered list1. Now there is no duplicate value now.

How to Compare Two Columns and Remove the Duplicate Values by Formula 9


Related Functions

  • Excel IF function
    The Excel IF function perform a logical test to return one value if the condition is TRUE and return another value if the condition is FALSE. The IF function is a build-in function in Microsoft Excel and it is categorized as a Logical Function.The syntax of the IF function is as below:= IF (condition, [true_value], [false_value])….
  • Excel ISERROR function
    The Excel ISERROR function used to check for any error type that excel generates and it returns TRUE for any error type, and the ISERR function also can be checked for error values except #N/A error, it returns TRUE while the error is #N/A. The syntax of the ISERROR function is as below:= ISERROR (value)….
  • Excel MATCH function
    The Excel MATCH function search a value in an array and returns the position of that item.The syntax of the MATCH function is as below:= MATCH  (lookup_value, lookup_array, [match_type])….
Related Posts

VLOOKUP From Another Sheet Not Working
vlookup from another sheet not working3

In the previous post, you should know that how to fix or remove the #N/A error when using VLOOKUP formula to lookup value from another sheet. And this post will show you reasons why your VLOOKUP formula is not working ...

Case Sensitive Lookup with SUMPRODUCT and EXACT

Today, we will show you how to use SUMPRODUCT and EXACT to perform a case sensitive exact match. In this article, we provide a simple example to calculate bonus for employees whose names are case-sensitive. If you meet similar scenarios ...

Basic Usage of INDEX & MATCH – Case Sensitive Lookup

In Excel, INDEX function and MATCH function are often used together for retrieving data from a particular position. MATCH function is one of Excel lookup & reference functions that can perform approximate match or exact match by setting different match ...

Basic Rates Calculation by VLOOKUP Based on Weight Band

Microsoft Excel provides many functions that can execute logical test, search data, return current date and something else. They are very useful in daily work. And Excel VLOOKUP function is one of Excel most frequently used functions. It belongs to ...

Basic Grade Calculation by VLOOKUP Function – Approximate Match

In Excel, except combination INDEX+MATCH, we can also apply other functions to search data, for example VLOOKUP function. Like MATCH function, VLOOKUP function is one of Excel lookup & reference functions that can perform approximate match or exact match by ...

Basic Discount Calculation with VLOOKUP Function

In Excel, except combination INDEX+MATCH, we can also apply other functions to search data, for example VLOOKUP function. Like MATCH function, VLOOKUP function is one of Excel lookup & reference functions that can perform approximate match or exact match by ...

Basic Usage of INDEX & MATCH – Exact Match
Basic Usage of INDEX & MATCH - Exact Match 1&2

In Excel, INDEX function and MATCH function are often used together for returning value or cell reference or range reference from specified position. And MATCH function is one of Excel lookup & reference functions that can perform approximate match or ...

Basic Usage of INDEX & MATCH – Approximate Match

In Excel, INDEX function and MATCH function are often used together for returning value or cell reference or range reference from specified position. And MATCH function is one of Excel lookup & reference functions that can perform approximate match by ...

Approximate Match with Multiple Criteria by INDEX & MATCH
Approximate Match with Multiple Criteria by INDEX & MATCH 1 & 2

In Excel, INDEX function and MATCH function are often used together for returning data from specific position. And MATCH function is one of Excel lookup & reference functions that can return approximate value by setting match type. Above all, through ...

How to Count Cells Not Equal to One of Many Things in Excel
count cells not equal many things10

This post will guide you how to count the number of cells that are not equal to many things in a given range cells using a formula in Excel 2013/2016. You can easily to count cells not equal to a ...

Sidebar