Highlight Differences Between Two Columns

Excel Formulas › Conditional Formatting

All versionsComparison

Spot where two columns disagree — old vs new, expected vs actual. A simple <> rule highlights every row where the values don’t match.


Quick formula: select both columns (A:B), add a rule:
=$A1 <> $B1
Highlights cells in rows where column A differs from column B. Lock the columns so each row compares its own A and B.

Functions used (tap for the full reference guide):

The example

Rows where the two values differ are flagged.

AB
1OldNew
2100100
3250275

The formula

The rule that flags mismatches:

=$A1 <> $B1 // TRUE where the two columns disagree

How it works

A not-equal test per row:

  1. Select both columns (e.g. A1:B100), then add a formula rule =$A1 <> $B1.
  2. The column letters are locked ($A, $B) but the row floats, so each row compares its own pair.
  3. Cells in mismatching rows get the format; matching rows stay plain.
  4. For case-sensitive comparison, use =NOT(EXACT($A1, $B1)).

Find matches instead with =$A1=$B1, or count the differences with =SUMPRODUCT(--(A1:A100<>B1:B100)). To compare whole rows across many columns, AND the column tests together.

Try it: interactive demo

Live demo

Pairs “old,new”; differences highlight.

Variations

Case-sensitive

Treat case as a difference:

=NOT(EXACT($A1, $B1))

Highlight matches

Flip the test:

=$A1 = $B1

Count differences

How many disagree:

=SUMPRODUCT(--(A1:A100<>B1:B100))

Pitfalls & errors

Lock columns, free rows. Use $A1/$B1 — relative rows so each line compares itself, absolute columns so it always looks at A and B.

Text vs number. “100” as text won’t equal 100 as a number — clean types first if a “difference” looks wrong.

Case is ignored by default. <> sees “abc” and “ABC” as equal; use EXACT for case sensitivity.

Practice workbook

📊
Download the free Highlight Differences Between Two Columns practice workbook
A two-column compare with the difference CF rule, the case-sensitive and match variants, plus 4 challenges with answers. No sign-up required.

Frequently asked questions

How do I highlight differences between two columns in Excel?
Select both columns and add a formula CF rule =$A1 <> $B1. It flags each row where the two columns disagree.
How do I make the comparison case-sensitive?
Use =NOT(EXACT($A1, $B1)), since the <> operator ignores case.
How do I count how many rows differ?
Use =SUMPRODUCT(--(A1:A100<>B1:B100)).

Stop fighting formulas. Learn them in a day.

This recipe is one of hundreds of real-world formulas we teach. Our Excel Formulas & Functions class covers lookups, logic, text, and dynamic arrays hands-on — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.

See the Formulas & Functions Class

Related formulas: Flag duplicates · Highlight with a formula · Case-sensitive lookup

Function references: EXACT