if statement

  • Thread starter Thread starter RichardO
  • Start date Start date
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
 
=IF(O2>1,if(ISNA(VLOOKUP(D2,table,5,0),"",VLOOKUP
(D2,table,5,0),"").

i think this should work
 
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)
 
Back
Top