Excel Formula to Compare Two Columns (Step-by-Step Guide)

Learn how to compare two columns in Excel using formulas and identify mismatches quickly. Step-by-step guide for accountants and finance professionals.

3/7/20261 min read

Excel Formula to Compare Two Columns (Step-by-Step Guide)

Comparing two columns is a common task in Excel, especially for accountants performing reconciliation or data validation.

You may need to compare columns to:

  • Identify mismatched transactions

  • Reconcile financial records

  • Detect duplicate entries

  • Verify imported data

In this guide, you will learn several methods to compare two columns in Excel.

Example Data

Ledger AmountBank Amount500500700650900900

Our goal is to identify mismatched values.

Method 1: Using IF Formula

The simplest formula to compare two columns is the IF function.

=IF(A2=B2,"Match","Mismatch")

Result:

LedgerBankResult500500Match700650Mismatch900900Match

Method 2: Highlight Differences with Conditional Formatting

You can highlight mismatches automatically.

Steps:

  1. Select the column

  2. Click Conditional Formatting

  3. Use formula rule

Formula:

=A2<>B2

This highlights mismatched values.

Method 3: Find Missing Values Using XLOOKUP

Another common accounting task is checking if values exist in another column.

Example:

=XLOOKUP(A2,B:B,B:B,"Not Found")

If the value does not exist, Excel returns Not Found.

When Accountants Compare Columns

Comparing columns is commonly used for:

  • Bank reconciliation

  • Vendor payment verification

  • Inventory reconciliation

  • Audit testing

Generate Comparison Formulas Automatically

Instead of writing formulas manually, accountants can generate them instantly using AI.

Example prompt:

Compare two columns and show mismatch if values are different

An AI tool will generate the correct Excel formula automatically.

Try it here:

https://smartsideai.lovable.app

Conclusion

Comparing two columns in Excel is essential for reconciliation and data validation. Functions like IF, XLOOKUP, and conditional formatting make it easy to identify mismatches.

However, writing formulas manually can take time.

AI tools like SheetAI allow accountants to generate Excel formulas instantly using plain English.

Try it here:

https://smartsideai.lovable.app