if statement

R

RichardO

Hello everyone:

I have an if statement problem as follows:

=IF(O2>1,VLOOKUP(D2,table,5,0),""). That is if O2 is greater than 1
then do a vlookup, if O2 is not greater than 1, put a blank.

This works okay. Sometimes however, the vlookup comes back with
#N/A, I want to include an if formula that if it comes back with a
#N/A it should also return a "", i.e. a blank.

Thank you for your kind help.


RichardO
 
K

keyur

=IF(O2>1,if(ISNA(VLOOKUP(D2,table,5,0),"",VLOOKUP
(D2,table,5,0),"").

i think this should work
 
B

Bob Phillips

You've got a couple of missing brackets in this formula

=IF(O2>1,IF(ISNA(VLOOKUP(D2,table,5,0)),"",VLOOKUP(D2,table,5,0)),"")

and her is a slight alternative

=IF(OR(O2<=1,ISNA(VLOOKUP(D2,table,5,0))),"",VLOOKUP(D2,table,5,0))

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

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