Vlookup returning false as value

I am trying in include an IF statement to say that if the cell says "PAINT" do one thing and if it says anything else, do another (VLOOKUP) If The cell says PAINT then it works as it should. However, if the cell says anything else then I get a value of "FALSE". I am new to VLOOKUP so I suspect that could very well be the problem.

Thank you

=IF(N20="Paint",P20-(VLOOKUP(B20,CODES!$F$2:$G$22,P20-(VLOOKUP(B20,CODES!$J$2:$K$22,2)))))

Answers


You will need to do something like

 =IF(N20="paint",VLOOKUP(B20,CODES!$F$2:$G$22,2,0),VLOOKUP(B20,CODES!$J$2:$K$22,2,0))

At the end of your first VLOOKUP you need to specify which column to return the value from on your 'CODES' sheet, I've pointed to Col G by using '2' and '0' returns an exact match. Then close the 'True' VLOOKUP and start your False VLOOKUP


Need Your Help

easiest way to apply the same mod_rewrite rules to many virtualhosts?

apache mod-rewrite virtualhost vhosts

I have lots and lots of virtualhosts to support lots and lots of client domains. I want to add a feature to my core app that requires a couple mod_rewrite rules to be applied to ALL those domains. ...

Java: Marshal unmarshal to .properties format?

java properties jaxb marshalling

Note, this is not about marshaling a properties object.