Match or Lookup help please...

S

Soth

Hi,

I'd like to lookup items in two different column. If item in column A,
matches item in column B, then indicate #1, otherwise show #2. I'm not sure
how to wright whether a match or vlookup formula. Your is appreciated.

Thank you,
Soth
 
R

Rick Rothstein

What exactly do you mean by "if item in column A matches item in column B"?
Is that a line by line match or does the item in column A match any cell's
item in Column B, no matter what row? If the former, then this...

=IF(A1=B1,1,0)

or, because of the particular output values you are looking for, this...

=--(A1=B1)

If the latter, then try this...

=IF(COUNTIF(B:B,A1)>0,1,0)

or, again because of the particular output values you are looking for,
this...

=--(COUNTIF(B:B,A1)>0)
 
S

Soth

Yes, it's a line by line match. i.e

Column A Column B Colum C

John John = return value
of 1 if match, else 2
Smith Bob
Mary Jennifer

Thank you
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top