Multiple If Statement on a Vlookup

bspence

New Member
Joined
Jul 31, 2017
Messages
13
Hello, need help and struggling with a multiple If statement on a vlookup

=IF(VLOOKUP(A7,'Stock Planning - All Orders on MOM By Line Not Shipped.csv'!$C:$F,4,0)="BO","No","Yes")

I want to also include if the vale in the lookup is PB as well as BO,

How do i do this?
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Welcome to the board.Try:
Code:
=IF(IFERROR(FIND(VLOOKUP(A7,'Stock Planning - All Orders on MOM By Line Not Shipped.cvs'!$C:$F,4,0),"BOPB"),0)>0,"No","Yes")
Alternatively, you could replace string values of "No" and "Yes" with Boolean values, (FALSE or TRUE) with:
Code:
IFERROR(FIND(VLOOKUP(A7,'Stock Planning - All Orders on MOM By Line Not Shipped.cvs'!$C:$F,4,0),"BOPB"),0)=0
 
Upvote 0
=IF(OR(VLOOKUP(A7,'Stock Planning - All Orders on MOM By Line Not Shipped.csv'!$C:$F,4,0)="BO",VLOOKUP(A7,'Stock Planning - All Orders on MOM By Line Not Shipped.csv'!$C:$F,4,0)="PB"),"No","Yes"

Please try above formula.
 
Upvote 0
Thanks for the replies!

@Jackdanice

The code does not seem to work, i want it to return Yes if it finds either BO or PB seperately in the vlookup cell, any advice?

Can it do this to a CSV instead of an xls?
 
Upvote 0
Hello, need help and struggling with a multiple If statement on a vlookup

=IF(VLOOKUP(A7,'Stock Planning - All Orders on MOM By Line Not Shipped.csv'!$C:$F,4,0)="BO","
No","Yes")

Try:
Rich (BB code):
=IF(IFERROR(FIND(VLOOKUP(A7,'Stock Planning - All Orders on MOM By Line Not Shipped.cvs'!$C:$F,4,0),"BOPB"),0)>0,"Yes","No")
 
Upvote 0
Hey

But it wont find any BOPB

I want it to come back with no if it find a PB OR a BO on the vlookup, 2 seperate terms.

Any idea?
 
Upvote 0
jackdanice

Think it needs some Or in it for both? I want it to give me a result if it finds BO or PB, not together, how do i do that?
 
Upvote 0
This part does that:
Rich (BB code):
FIND(VLOOKUP(A7,'Stock Planning - All Orders on MOM By Line Not Shipped.cvs'!$C:$F,4,0),"BOPB")
By finding the VLOOKUP term in the string "BOPB", i.e. if "BO" matches any part of "BOPB" or "PB" matches any part of "BOPB", returning the position number of the match (1 or 3).It returns 0 if no match with the IFERROR wrapped around it, then you test if the value is greater than 0 ("Yes") or not ("No").

It works on filling cells A1:A3 with "BO", "PB", "AB" and running that part of the formula against it returning values of "Yes", "Yes" and "No" respectively.
 
Last edited:
Upvote 0
Try this

=IF(SUM(COUNTIFS(C1:C1000,A7,F1:F1000,{"PB","BO"}))<>0,"Pass","Fail")
This will return Pass for an existence of PB or BO or both in that column

=IF(AND(SUM(COUNTIFS(C1:C1000,A7,F1:F1000,{"PB","BO"}))<>0,
COUNTIFS(C1:C1000,A7,F1:F1000,"PB")*COUNTIFS(C1:C1000,A7,F1:F1000,"BO"))=0,"Pass","Fail")
This will return Pass for an existence of PB but no BO
or BO but no PB in that column
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,633
Latest member
DougMo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top