How to compare two columns row by row
✓ Verified in LibreOffice 25.8.7.3Check whether each row's values match between two columns — reconciling exports, before/after lists.
The formula
| App | Formula | Notes |
|---|---|---|
| Excel | =IF(A2=B2,"Match","Differ") | Case-insensitive. Case-sensitive: =IF(EXACT(A2,B2),"Match","Differ"). |
| Google Sheets | =IF(A2=B2,"Match","Differ") | Identical. |
| LibreOffice Calc | =IF(A2=B2,"Match","Differ") | Identical. |
How it works
The = operator ignores case ("Widget" = "widget" is TRUE), which is usually what you want; EXACT compares byte-for-byte, which is why the verified example returns "Differ". Count the mismatches in one cell with =SUMPRODUCT(--(A2:A100<>B2:B100)). The other common surprise: trailing spaces from exports make identical-looking cells differ — wrap both sides in TRIM when reconciling pasted data. (Comparing whole LISTS regardless of order is a different task — see the find-values-in-both-lists recipe.)
Verified, not just documented
We ran =IF(EXACT(A2,B2),"Match","Differ") in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned Differ — exactly the expected result. Every formula here is confirmed by actually executing it.