If Or statement with three criteria

Sheripres

Board Regular
Joined
Sep 7, 2011
Messages
91
I searched everywhere for this and cannot find it.
I have a formula that reads like this: =IF(OR(AH6=AN6,AL6+AM6=AN6,AT6>0),"","FLAG")
The problem is, my AT6 is a sum formula and if it is zero or a positive result, it should be "", otherwise, if it is negative, I need it to be FLAGGED, but when I added that to my existing formula with the other two criteria, it won't recognize the negative numbers.

Thank you,

Sheri
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
The way you have written it, if ANY of your 3 conditions is met, it will return "".
So even if AT6 is negative, if AH6=AN6 or if AL6+AM6=AN6, then it will return "".

You need to decide if there is a precedence and what order to go in.
If you can list out all the conditions and what you want to happen in plain English, we can help you structure it correctly.
 
Upvote 0
Thank you for the quick response!
Then that is my issue; I don't want it find the first met condition; I want it to go thru all three and find the one that does NOT meet the condition (if it exists) and I need it to be "FLAGGED", Usually, one of the three conditions will be a "FLAG", but not all three. I hope that makes sense.

Here it is simply put:
If A2 = D2
OR
if B2+C2=D2
OR
if E2>0, I want it to be blank, otherwise, I need it to be FLAGGED.

When I created it with the first two criteria, it worked, but when I added that last one, it doesn't work correctly.
Here is the formula that won't work correctly.

=IF(OR(A2=D2,B2+C2=D2,E2>0),"","FLAG")
 
Upvote 0
Change you approach on your formula. Indicate in each condition what would mark it to be flagged. Then check that in your OR statement.
Then if any one of those three conditions is met, it will return flagged.

Maybe something like:
Excel Formula:
=IF(OR(A2<>D2,B2+C2<>D2,E2<0),"Flagged","")
 
Upvote 0
Sorry; it didn't work. I did try that before, but not with the <>. It FLAGGED everything.

Don't know if it matters, but the cells that are getting referenced have formulas in them too.
 
Upvote 0
Sorry; it didn't work. I did try that before, but not with the <>. It FLAGGED everything.

Don't know if it matters, but the cells that are getting referenced have formulas in them too.

OK, let's make sure that we are both on the same page here. Let me know if this is what you want to happen:

If ANY one of the three conditions is True, return "FLAGGED":
1. A2<>D2
2. B2+C2<>D2
3. E2<0

Is that what you want to happen?
If not please try explaining again.
If so, but the formula does not appear to be working, provide us with an example that is not working. In that example, tell us what the formula in each cell is, and what the value being returned in each cell is.
 
Upvote 0
Yes. That is what I mean. I wrote it simple for my question, but here are the actual cells. I have the first row showing the formulas. All results are numbers. I hope you can see this.

Thank you!
 

Attachments

  • IF OR STATEMENT ISSUE.jpg
    IF OR STATEMENT ISSUE.jpg
    162 KB · Views: 6
Upvote 0
Without also seeing the values being returned in those cells in purple, is not that helpful.
I want to see an actual example of one that is not working for you, and seeing what the value being returned by each of those cells is.
I cannot analyze it without that information.
 
Upvote 0
That is okay. I will figure it out another way. I can probably do two separate formulas and merge them with blanks thru the F5 key.

Thanks anyways! I appreciate you trying. :)
 
Upvote 0

Forum statistics

Threads
1,215,067
Messages
6,122,949
Members
449,095
Latest member
nmaske

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