View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Harlan Grove[_2_] Harlan Grove[_2_] is offline
external usenet poster
 
Posts: 1,231
Default comparing two columns

"T. Valko" wrote...
One way...


And the slow way . . .

Comparing column B to column A with the list in column A in the range
A1:A20.

=IF(COUNTIF(A$1:A$20,B1),"match","")


Bit faster to use

=IF(COUNT(MATCH(B1,A$1:A$20,0)),"match","")

or just

=MATCH(B1,A$1:A$20,0)

which would return a number when there's a match and #N/A when there
isn't.