if & vlookup

R

RmB

Version: 2008
Operating System: Mac OS X 10.5 (Leopard)
Processor: Intel

This formula returns correct answer for "Black" but returns "#" for "Blue". The second IF doesn't retrieve data form column 3.

=IF(C4="Black",VLOOKUP(C10,vlookuptable,2,IF(C10="Blue",VLOOKUP(C10,vlookuptable,3,0))))

Help please? Thank You, RmB
 
N

Niek Otten

I find it rather unlikely that this is really your formula. Are you indeed
trying to lookup "Blue" if you already know it is "Blue"? Or did you mean

........IF(C4="Blue", VLOO....etc? (as opposed to IF(C10="Blue"...)

What if neither C4 is Black or C10 is Blue?

Maybe you should explain in words, not in formulas, what you are trying to
achieve.
 
R

RmB

Part of the post was dropped--formula should read
=IF(C4="Black",VLOOKUP(C10,vlookuptable,2,
IF(C10="Blue",VLOOKUP(C10,vlookuptable,3,))))
RmB
 
C

CyberTaz

Well, I don't see where anything was "dropped" but this is definitely a
different version of the formula :) I see the following errors:

A) There should be a Right Paren between the 2 and the comma behind it,
B) There should NOT be a comma following the 3,and
C) There is one too many Right Parens at the end, so

=IF(C4="Black",VLOOKUP(C10,vlookuptable,2),
IF(C10="Blue",VLOOKUP(C10,vlookuptable,3)))

should not produce the error if the references are valid.

As Niek mentioned, however, I don't know that this will resolve your problem
as I have no idea what the intent is or what the result should be, but it
should at least correct the syntax.

HTH |:>)
Bob Jones
[MVP] Office:Mac
 
R

RmB

Yes .......IF(C4="Blue", VLOO....etc? (as opposed to IF(C10="Blue"...)
also left out the close parenthesis on the first vlookup. Silly errors. thanks for your help.RmB
 

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

Similar Threads


Top