Skip to main content

How to compare two columns and delete matches in Excel?

Author: Sun Last Modified: 2024-09-03

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:

enter a formula to compare two columns
drag and fill this formula to other cells

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:

click Data > Filter

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

check Duplicate only from the Filter drop down

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.

select the duplicate values
arrow down
press Delete key to delete them

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.

all the matches of two compared columns are deleted


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 offers over 300 advanced features to streamline complex tasks, boosting creativity and efficiency. Itegarate with AI capabilities, Kutools automates tasks with precision, making data management effortless. Detailed information of Kutools for Excel...         Free trial...

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

Select And Remove Matches

 

You may be interested in these articles:


Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...


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!