Excel IF statement with vlookup

Joined
Sep 19, 2017
Messages
1
Reaction score
0
Hello, I'm trying to come up with a formula using If and vlookup. Basically, IF A1=CS, vlookup to this column if not vlookup in this column. I also need to make sure that if that vlookup doesnt find anything to return 0. Thanks!
 
It can be done and here is a example.

=IF(A1="CS",VLOOKUP(B1,M:O,3,0),VLOOKUP(C1,P:R,3,0))

Vlookup 1 is if it is CS

Vlookup 2 is if it is NOT CS obviously i have made the vlookup just look elseware on the sheet you will need to put in your own vlook up. I hope this helps
 
and if you don't find anything on the vlookups then you can up an IFERROR function before it like thus.

=IFERROR(IF(A1="CS",VLOOKUP(B1,M:O,3,0),VLOOKUP(C1,P:R,3,0)),0)
 
Back
Top