How to Compare Two Columns in Excel and Find Mismatched Values
Question details
The user needs to compare reference numbers and their corresponding values across two Excel tables to find mismatched data and identify missing references.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Comparing two datasets to reconcile data, identify discrepancies between paired values, and locate records that are missing from either table.
- Observed behavior
- The user wants to output specific status labels such as 'Value does not match' or 'Reference missing' based on the column comparison results.
Ensure that your reference numbers in both tables are formatted consistently (e.g., both formatted as Text or both as Numbers) to avoid false mismatch errors during the comparison.
Use VLOOKUP and IF Formulas to Compare Column Pairs
The fastest way to compare two column pairs and automatically flag mismatched or missing values using combined Excel functions.
By nesting VLOOKUP inside an IF function, you can check if the value from the second table matches the first table. Adding IFERROR helps handle situations where the reference number does not exist in the second table.
Click on a blank cell (e.g., C2) directly next to the first data pair in your first table.
Input the formula: =IFERROR(IF(VLOOKUP(A2,D:E,2,0)<>B2,"Value does not match",""),"Reference missing"). In this formula, A2 is the reference number, D:E is the second table's range, and B2 is the value to compare against.
Press Enter to see the result. Click the cell again, grab the fill handle in the bottom-right corner, and drag it down to apply the formula to all rows.

Use Power Query to Merge and Compare Tables
Ideal for large datasets in Excel 365 to visually identify unique and mismatched references without writing complex formulas.
Easily Compare and Reconcile Data with WPS Spreadsheet
WPS Spreadsheet provides powerful data processing capabilities, fully supporting VLOOKUP, XLOOKUP, and nested IF functions to quickly compare columns, identify mismatches, and reconcile massive datasets.
- 1. Open your dataset: Launch WPS Spreadsheet and open the workbook containing the two tables you want to compare.
- 2. Input the comparison formula: Click on a blank cell adjacent to your first table and type =IFERROR(IF(VLOOKUP(A2,D:E,2,0)<>B2,"Mismatch",""),"Missing").
- 3. Auto-fill the column: Press Enter, then double-click the small square at the bottom right of the cell to instantly apply the comparison logic to thousands of rows.

Frequently Asked Questions
Why is my VLOOKUP returning a mismatch when the values look identical?
This usually happens due to hidden trailing spaces or mismatched data types (e.g., numbers stored as text). Use the TRIM function to remove extra spaces, or ensure both columns share the exact same number format.
Can I highlight the mismatched cells instead of using a formula output text?
Yes. You can select your value column, go to Home > Conditional Formatting > New Rule, and use a formula like =$B2<>VLOOKUP($A2,$D:$E,2,FALSE) to automatically apply a red background color to any mismatched values.
Is there a quick way to compare two columns in the same row without VLOOKUP?
If you are strictly comparing two columns row-by-row (e.g., Column A and Column B), you can simply use the exact formula =A2=B2, which will return TRUE if they match and FALSE if they do not. Alternatively, select both columns, press Ctrl+G, click Special, select 'Row differences', and click OK to highlight discrepancies.




