lookup help

L

lostinmacro

I have this formula in cell A2
=LOOKUP(B2,{" ",19,50},{" ","1","2"})+A1
if I enter a value in B2 it works fine but if I leave it blank I get an
error that a value is not available.
What I would like is that if there is no value in B2 then A2 would stay
blank.
 
T

T. Valko

The way that your formula is written is if B2 is <19 then it returns a space
character. If that condition is ever true then space + A1 will return the
error #VALUE!. If B2 is empty then it returns the error #N/A.

So, try it like this:

=IF(B2<19,"",LOOKUP(B2,{19,50},{1,2})+A1)
 
T

T. Valko

A few keystrokes shorter...

Assuming B2 is *always* a number (or empty):

=IF(B2<19,"",IF(B2<50,1,2)+A1)
 

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