Lookup and IF functions I think?? Need Help!!!!

G

Guest

Below is a sample of the details I want to display

A B
1 CODE1 DISPLAY1
2 CODE2 DISPLAY2
3 CODE3 DISPLAY3

I want to display the corresponding value in column B in E7 (see below), if
one of the three cells E4:E6 displays that code.

E
4 BLANK CELL
5 CODE2
6 BLANK CELL
7 DISPLAY2

can this be done, and how would it be done??
 
B

Bob Phillips

=IF(COUNTA(A4:A6)=0,"",VLOOKUP(IF(A4<>"",A4,IF(A5<>"",A5,A6)),A1:B3,2,FALSE))

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
G

Guest

Maybe this in E7

=IF(ISNA(VLOOKUP(E5,A1:B3,2,FALSE)),"",VLOOKUP(E5,A1:B3,2,FALSE))


if you not bothered about the #NA error if the lookup value isnt found then
the formula can be shortened to

=VLOOKUP(E5,A1:B3,2,FALSE)

Mike
 

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