Nested If Statements and Lookup function

  • Thread starter Thread starter Peggi Stabler
  • Start date Start date
P

Peggi Stabler

I have two cells that I need to check before I can lookup
a value. I thought I did it right with nested if's and
then lookup within the 'true' part of the if, but it's not
working.

Here's what I got:
1) Check the first cell (a1) for 4,6,8,10 or 12;
2) Then check the second cell (a2) for
15,20,25,30,35,40,45,50,55,60,65,70,75 or 80;
3) Then based on the second cell's value (a2) go lookup
the appropriate value in a table (b1:c14):
15 100
20 190
25 290
30 400
35 520 etc. etc.

I tried this:
=if(a1=4,lookup(a2,b1:b14,c1c14),if(a1=6,lookup
(a2,b1:b14,c1c14),if(a1=8,lookup(a2,b1:b14,c1c14),if
(a1=10,lookup(a2,b1:b14,c1c14),if(a1=12,lookup
(a2,b1:b14,c1c14),"no!")))))
but it says I have too many arguments for this function,
etc. and it won't work.

Any ideas?? Even if it's another list or a better way to
search-I don't care, I just want it to work!

Thanks!!!
Peggi
 
Hi
could you explain why you want to test cell A1 for one of the values as
you didn't use this value in your VLOOKUP function afterwards. You may
try:
=IF(OR(A1=4,A1=6,A1=8,A1=10,A1=12),VLOOKUP(A2,B1:C14,2,0),"don't know")
 
Hi


Frank Kabel said:
Hi
could you explain why you want to test cell A1 for one of the values as
you didn't use this value in your VLOOKUP function afterwards. You may
try:
=IF(OR(A1=4,A1=6,A1=8,A1=10,A1=12),VLOOKUP(A2,B1:C14,2,0),"don't know")


Or
=IF(A1={4,6,8,10,12},VLOOKUP(A2,B1:C14,2,0),"don't know")
 
Hi Arvi
thanks for that addition. Due to my non english version I don't use the
={....} syntax as I always have problems with the delimiter :-)

But this is definitely better!

Frank
 
Please forward your answers to my work e-mail at:
(e-mail address removed)

When I tried to read the answers to my post, it
says 'Message unavailable' (see below).

Why is this?! Some one posted the same thing but no one
answered. I can see some messages, but not others.

Thanks!
Peggi
 
Back
Top