This problem can be solved with the COUNTIF function or with the MATCH function.
Each approach is explained below.
COUNTIF function
TheCOUNTIF functioncounts values in a range that meet supplied criteria.
A positive number represents the count of a value inrange2that was found inrange1.
A zero indicates a value that was not found.
However, it must be entered as anarray formulawith control + shift + enter.
In thecurrent version of Excel, it just works.
If you want to compare two ranges and count matches at the row level (i.e.
only count matches when the same item appears in the same position), you’ll need adifferent formula.
MATCH supports approximate and exact matching, andwildcards(* ?)
COUNT Function
The Excel COUNT function returns a count of values that are numbers.
Numbers include negative numbers, percentages, dates, times, fractions, and formulas that return numbers.