IF statement help

P

pmg2003

I am try to create a IF statement thats works as follows:

The workbook has 2 sheets

if A1 on sheet #1 equals any cell in column A on sheet #2 then display
the value of the adjacent B cell of sheet #2 on the B2 cell of sheet #1

I hope this makes sense....

TIA,

Paul
 
J

Jason Morin

=IF(COUNTIF(Sheet2!A:A,A1),VLOOKUP(A1,Sheet2!A:B,2,0),"Not
Found")

HTH
Jason
Atlanta, GA
 
O

OZDOC1050

=IF(ISERROR(OFFSET(Sheet2!B1,MATCH(A1,Sheet2!A:A,0)-1,0)),"",OFFSET(Sheet2!B
1,MATCH(A1,Sheet2!A:A,0)-1,0))

in cell b2 sheet 1 Just 1 way
R
Pete
 
O

OZDOC1050

SORRY CELL A2

OZDOC1050 said:
=IF(ISERROR(OFFSET(Sheet2!B1,MATCH(A1,Sheet2!A:A,0)-1,0)),"",OFFSET(Sheet2!B
1,MATCH(A1,Sheet2!A:A,0)-1,0))

in cell b2 sheet 1 Just 1 way
R
Pete
 
D

Dan E

Another Way,

In B2 put
=VLOOKUP(A1,Sheet2!A1:B50,2,FALSE)

Adjust A1:B50 for your range

Returns #N/A if no match is found so if you wanted something
else to be in B2 if no match is found

=IF(ISNA(VLOOKUP(A1,Sheet2!A16:B21,2,FALSE)),
"Something Else", VLOOKUP(A1,Sheet2!A16:B21,2,FALSE))

Dan E
 
P

pmg2003

cool.. thanks everyone!!!!

Dan E said:
Another Way,

In B2 put
=VLOOKUP(A1,Sheet2!A1:B50,2,FALSE)

Adjust A1:B50 for your range

Returns #N/A if no match is found so if you wanted something
else to be in B2 if no match is found

=IF(ISNA(VLOOKUP(A1,Sheet2!A16:B21,2,FALSE)),
"Something Else", VLOOKUP(A1,Sheet2!A16:B21,2,FALSE))

Dan E
 

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