sturdybits

Guides / Compare Sheets

How to compare two columns in Excel for differences

30 November 2026

To compare two columns in Excel row by row, put =A2=B2 in a spare column and fill it down: TRUE means the two cells match and FALSE means they differ. To highlight the differences instead, select both columns and add a conditional formatting rule, or use Go To Special > Row differences. These methods compare each cell with the one beside it in the same row. If your two columns are lists in a different order, see how to compare two lists and find missing items instead.

The examples assume the values are in columns A and B, from row 2 down, with headings in row 1.

1. A quick formula: =A2=B2

Good for: any version of Excel, on Windows, Mac or the web.

  1. In C2, enter =A2=B2.
  2. Fill it down to the last row. Double-clicking the fill handle, the small square at the bottom-right of the cell, does this for you.

Turn on Data > Filter and filter column C for FALSE to see only the rows that differ. For a label instead of TRUE or FALSE, wrap the comparison in IF:

=IF(A2=B2, "", "Different")

To see both values in one cell when they differ:

=IF(A2<>B2, A2 & " | " & B2, "")

To count the rows that differ without a helper column:

=SUMPRODUCT(--(A2:A500<>B2:B500))

The -- turns TRUE and FALSE into 1 and 0 so SUMPRODUCT can add them up. Rows where both cells are empty count as a match.

2. EXACT, when upper and lower case matter

Good for: product codes, references and anything where "ab-101" and "AB-101" should count as different.

The equals sign ignores case, so =A2=B2 says "ab-101" and "AB-101" match. The EXACT function is case-sensitive:

=IF(EXACT(A2, B2), "", "Different")

EXACT ignores formatting, so a number shown as £5.00 in one column and 5 in the other still counts as a match. To count case-sensitive differences in one go, use =SUMPRODUCT(--NOT(EXACT(A2:A500, B2:B500))).

3. Highlight differences with conditional formatting

Good for: seeing the differences in the columns themselves, and keeping them highlighted as the data changes.

  1. Select A2:B500, both columns from the first data row.
  2. Choose Home > Conditional Formatting > New Rule, then Use a formula to determine which cells to format.
  3. Enter =$A2<>$B2.
  4. Choose Format, pick a fill colour on the Fill tab, and choose OK twice.

Both cells in each row that differs are shaded. The $ before each column letter keeps the rule comparing A with B wherever it's applied, while the row number changes for each row. To shade the whole row of a table, select from column A to the last column before adding the rule. For a case-sensitive version, use =NOT(EXACT($A2, $B2)).

You'll often see Highlight Cells Rules > Duplicate Values suggested for this. It doesn't compare row by row: it highlights a value that appears anywhere else in the selection, so "Leeds" in A5 counts as a duplicate of "Leeds" in B90. Switching it to Unique finds values that appear only once across both columns. That's useful for two lists, but not for checking each row.

4. Go To Special > Row differences

Good for: a quick one-off check with no formulas, in Excel for Windows or Mac.

  1. Select both columns of data by dragging from A2, so that A2 is the active cell.
  2. On Windows, choose Home > Find & Select > Go To Special, or press Ctrl+G and choose Special. On a Mac, choose Edit > Find > Go To, then Special.
  3. Choose Row differences, then OK.

Excel selects every cell in column B that differs from column A in the same row. Give them a fill colour from the Home tab straight away, because the selection is lost as soon as you click elsewhere.

Microsoft's Go To Special help explains that each row is compared with the cell in the active cell's column. That matters when you select more than two columns: start from the column you want to compare the others with. Unlike conditional formatting, the colour doesn't update when the values change, so run it again after edits.

Why two cells that look the same don't match

If a row is flagged as different and you can't see why, it's usually one of these:

When to compare whole sheets instead

Two-column formulas work well when the rows line up. They stop working when:

That last case is the job Compare Sheets does. Drop in the two files and it lines up the rows, even when some were inserted, deleted or moved, or matches them by an ID column. It then shows every changed cell with its old and new value. It can ignore extra spaces, upper and lower case, and number differences below a limit you set, and it treats a number stored as text the same as the number. It runs in your browser on Windows or Mac, and your files never leave your computer. The free version compares the first 1,000 rows of each sheet; Pro is £19 once. You can try it with sample files.

Quick answers

What's the formula to compare two columns in Excel? =A2=B2 returns TRUE when the cells match. =IF(A2=B2, "", "Different") labels the rows that differ. Use EXACT instead of the equals sign if upper and lower case matter.

How do I highlight the differences between two columns? Select both columns and add a conditional formatting rule with the formula =$A2<>$B2. Or use Go To Special > Row differences and give the selected cells a fill colour.

Why does Excel say two identical cells are different? Usually a stray space, a number stored as text, or decimals hidden by the number format. Compare with TRIM, &"" or ROUND, as shown above.