简体   繁体   中英

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)))))

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM