if statement issue

bluepenink

Well-known Member
Joined
Dec 21, 2010
Messages
585
Hello

this is my if statement

cell S2:
=IF(J2>MAX(LEFT(R2,FIND("-",R2,1)-1),MID(R2,FIND("-",R2,1)+1,1)),"No","Yes")

R2 = 3-5 days

the issue, im having, when R2 contains data like i.e. "E2W on Wednesday" etc, it shows the N/A error. How can I make the formula state, if R2 contains anything that beings with "E", to show "Yes" as well?

pls help, thx you
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
=IF(left(r2,1)="E","Yes",IF(J2>MAX(LEFT(R2,FIND("-",R2,1)-1),MID(R2,FIND("-",R2,1)+1,1)),"No","Yes"))
 
Upvote 0
oh wow, thx you so much

one final question

is it possible to integrate another if or criteria?

a) If the R2 = "P" then "YES" also

and

b) if R2 = "" then "YES" as well

thx you so much...im all over the place wid this formula, thxs for ur help again!
 
Upvote 0
Then you can add if conditions to get formula like:
IF(LEFT(R2,1)="E","Yes",IF(LEFT(R2,1)="P","Yes",IF(R2="","Yes",IF(J2>MAX(LEFT(R2,FIND("-",R2,1)-1),MID(R2,FIND("-",R2,1)+1,1)),"No","Yes"))))
 
Upvote 0
hello guys

one final request, and i truely appreciate the responses!

-Having some issue trying to place the logic in my if statement

=IF(OR(D2="",D2="0"),"",VLOOKUP(D2,'All stores'!$C$10:$S$954,17,FALSE))


basically, i would like to further show,

if the vlookup = "" then show ""

so basically, if the vlookup answer is a blank, show a blank; it is currently showing a 0 instead.

thx you so much!
 
Upvote 0
If it is a number then you do not need Double Quotes like:
=IF(OR(D2="",D2=0),"",VLOOKUP(D2,'All stores'!$C$10:$S$954,17,FALSE))
 
Upvote 0
Oh got it, thxs and finally, i keep getting an error with the formula below


=if(ISNUMBER(vlookup(C2,'OFFICE MAX - Invoices'!$C$2:$N$3379,12,false)))
 
Upvote 0
If it is a number then you do not need Double Quotes like:
=IF(OR(D2="",D2=0),"",VLOOKUP(D2,'All stores'!$C$10:$S$954,17,FALSE))

This will still result in a 0 if the result of the vlookup is a blank. All you need to do is wrap the VLOOKUP inside a T(). For instance,
=IF(OR(D2="",D2=0),"",T(VLOOKUP(D2,'All stores'!$C$10:$S$954,17,FALSE)))

Should give you "" if the VLOOKUP is successful, but the value found is blank.
 
Upvote 0
This will still result in a 0 if the result of the vlookup is a blank. All you need to do is wrap the VLOOKUP inside a T(). For instance,
=IF(OR(D2="",D2=0),"",T(VLOOKUP(D2,'All stores'!$C$10:$S$954,17,FALSE)))

Should give you "" if the VLOOKUP is successful, but the value found is blank.


wow that was very cool, thx you for that!
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,285
Members
452,902
Latest member
Knuddeluff

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