How To Compare Two Tables In Excel

3 min read

Comparing two tables in Excel is an essential skill for anyone working with data, whether you are reconciling financial records, auditing customer lists, or merging inventory sheets. When you need to identify matching records, spot missing entries, or highlight discrepancies between two datasets, knowing how to compare two tables in Excel can save hours of manual work and reduce costly errors. This guide walks you through the most reliable methods, from simple formulas to advanced Power Query techniques, so you can choose the approach that fits your dataset size and skill level.

Why You Might Need to Compare Two Tables in Excel

Data rarely stays in one place. You might receive a monthly sales report from one region and a master list from headquarters, or you may need to verify that a cleaned dataset matches the original source. Common scenarios include:

  • Finding duplicate customer records across two lists
  • Identifying products that exist in one inventory table but not another
  • Verifying that employee IDs in a payroll table match those in a benefits table
  • Detecting price changes between two supplier quotes

Regardless of the situation, the goal is usually the same: determine which rows match, which are unique, and where values differ.

Method 1: Using Excel Formulas to Compare Tables

Formulas are ideal for quick comparisons when your tables are relatively small and you want results directly inside your worksheet.

Using VLOOKUP for Exact Matches

The VLOOKUP function searches for a value in the first column of a table and returns a corresponding value from another column. To compare two tables, you can look up a unique identifier—such as an order number or email address—from Table A in Table B.

  1. Place your unique identifier in column A of Table A.
  2. In a new column next to Table A, enter a formula such as =VLOOKUP(A2, TableB[ID], 1, FALSE).
  3. If the formula returns a value, the record exists in both tables. If it returns #N/A, the record is missing from Table B.

VLOOKUP works well in older versions of Excel, but it only searches from left to right and can break if you insert columns in your lookup table No workaround needed..

Using XLOOKUP for Modern Workbooks

If you have Microsoft 365 or Excel 2021 and later, XLOOKUP is a more flexible replacement for VLOOKUP. It can search in any direction and returns a clear message when no match is found.

Example formula: =XLOOKUP(A2, TableB[ID], TableB[ID], "Not Found")

This formula checks whether the ID in cell A2 exists in Table B. If it does, it returns the ID; otherwise, it displays "Not Found."

Using COUNTIF to Spot Duplicates

The COUNTIF function counts how many times a value appears in a range. To compare tables, you can count occurrences of each Table A identifier within Table B.

Example: =COUNTIF(TableB[ID], A2)

A result of 1 means a match exists. A result of 0 means the item is unique to Table A.

Method 2: Highlight Differences with Conditional Formatting

Conditional formatting lets you visually flag mismatches without writing complex formulas. This method is especially helpful when you want to scan two tables side by side and immediately see which cells differ Most people skip this — try not to..

  1. Select the data range in the first table.
  2. Go to the Home tab, click **Cond
Just Finished

Hot off the Keyboard

See Where It Goes

Still Curious?

Thank you for reading about How To Compare Two Tables In Excel. We hope the information has been useful. Feel free to contact us if you have any questions. See you next time — don't forget to bookmark!
⌂ Back to Home