How to compare two columns and delete matches in Excel?

If you have two columns/lists including some duplicates, now you want to compare them and find out the matches, the delete them, how can you quickly solve? In this article, I introduce different ways to help you handle it in Excel.

Compare two columns and delete matches with formula

Compare two columns and delete matches with Kutools for Excel good idea3

Compare two columns and delete matches with formula

In Excel, I introduce formulas to help you find out the match ones.

1. Select a blank cell next to the first column you want to compare (Name1), here I select B1, and type this formula =IF(ISERROR(MATCH(A1,$C$1:$C$10000,0)),"Unique","Duplicate"), and press Enter key, and drag the autofill handle down to fill this formula to the cells. See screenshot:

doc compare delete match 1
doc compare delete match 2

Note: in the formula, A1 is the first cell of your first column which you need to compare and C1:C10000 is the column you want to compare with.

2. Then select the formula columns, and click Data > Filter. See screenshot:

doc compare delete match 3

3. Click at the arrow in the first cell of helper column, and check Duplicate only from the drop down list. See screenshot:

doc compare delete match 4

4. Click OK. Now only the duplicates are visible, select them in the Name1 column, and press Delete key in the keyboard to delete them.

doc compare delete match 5
doc arrow down
doc compare delete match 6

5. Click Data > Filter again to remove the filter, and then remove the formulas if you do not need it any more.

Now all the matches of two compared columns are deleted.

doc compare delete match 7

Compare two columns and delete matches with Kutools for Excel

With above method is somewhat troublesome, and you can use Kutools for Excel’s Compare Ranges function to quickly select the matches in two columns and then delete them.

Kutools for Excel, with more than 300 handy functions, makes your jobs more easier. 

After free installing Kutools for Excel, please do as below:

1. Select the two ranges that you want to compare by holding Ctrl key, then click Kutools > Select > Select Same & Different Cells. See screenshot:

doc compare delete match 14

2. In the Select Same & Different Cells dialog, Check My Data has headers if your selection contians headers (the selected headers must be same if you check this option), and the check Each row  and Same Values option. See screenshot:

doc compare delete match 15

3. Click Ok, a dialog pops out to tell you the number of selected cells.

doc compare delete match 16

4. Click OK to close the dialogs, and the match ones in first column are selected, and press Delete key to delete them.

doc compare delete match 17

If you want to highlight the same values between two columns, you can check Fill backcolor or Fill font color option and select a color you want from the list.
doc compare delete match 18

You may be interested in these articles:

The Best Office Productivity Tools

Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

  • Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial. 60-day money back guarantee.
kte tab 201905

Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
officetab bottom
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Sanjo · 1 months ago
    This is not working for numerical columns
  • To post as a guest, your comment is unpublished.
    agvdvdf · 10 months ago
    I tried but it gives an error :( But thanx
    • To post as a guest, your comment is unpublished.
      Sunny · 6 months ago
      Hi, if the formula get error, you can check if the reference is wrong, or you can try the second method above.