#N/A in lookup function

T

trapani81

Hi

I know this has been posted before but they only refer to VLOOKUP and
not the LOOKUP function.

I have created a function as -

=IF(Avail!I5="off","N/A",LOOKUP(J5,S6:S17,T6:T17))

I am searching availability on another sheet else a time slot is
allocated according to the value in cell J5 (for example). The problem
is when no data is in J5, I get the #N/A error.

How can I avoid this using the LOOKUP function as above (no VLOOKUP
suggestions please..!)

Many thanks!
 
M

Mike H

Maybe

=IF(Avail!I5="off","N/A",IF(ISNA(LOOKUP(J5,S6:S17,T6:T17)),"Do something
else",LOOKUP(J5,S6:S17,T6:T17)))


Mike
 
P

Pete_UK

Just use another IF clause, like so:

=IF(Avail!I5="off","N/A",IF(J5="","another
message",LOOKUP(J5,S6:S17,T6:T17)))

Hope this helps.

Pete
 
T

trapani81

That works a dream Mike... Thanks a lot- I can rest easy now on the
weekend..
cheers
 

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