Professional Documents
Culture Documents
How To Compare Two Columns in Excel For Matches and Differences
How To Compare Two Columns in Excel For Matches and Differences
For this, you can embed the COUNTIF($B:$B, $A2)=0 function in IF's logical test and
check if it returns zero (no match is found) or any other number (at least 1 match is
found).
For instance, the following IF/COUNTIF formula searches across the entire column B
for the value in cell A2. If no match is found, the formula returns "No match in B",
an empty string otherwise:
Tip. If your table has a fixed number of rows, you can specify a certain range (e.g.
$B2:$B10) rather than the entire column ($B:$B) for the formula to work faster on
large data sets.