IF Statements etc....

JT100392

New Member
Joined
Jan 5, 2017
Messages
16
Could someone explain what is wrong with this formula....

=IF(AND(C247<2,E257>0,IF(C247<3,E262>0)),"Please ensure all irrelevant options are blank","")

The first part works [BOLD] but the second part doesn't.

I'm not sure exactly why they cant work in conjuction?

Thanks
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Your code seems very strange to me. It is supposed to be a nested IF, or is the second IF supposed to be within the AND clause?
Either way, the C247<3 part seems to be unnecessary, as you are already checking to see if C247<2. If it is less than 2, then it will certainly be less than 3. so there is no need to check for that.

I have a feeling the problem is that the logic of your formula does not match the logic of what you want to happen.
Can you explain exactly how you want this to work?
 
Upvote 0
Can you share a small sample of data along with the desired outcome? Sharing only a non-working formula does not explain much at all.
 
Upvote 0
The part you say does not work is an IF Function that says if C247<3 then E262>0. I assume you want to check if every thing is true and if so return Please ensure all irrelevant options are blank if so use
=IF(AND(C247<2,E257>0,C247<3,E262>0),"Please ensure all irrelevant options are blank","")
 
Upvote 0
Hi Scott,

Unfortunately this isn't what i am trying to get at.

I need the message to appear when C247 = 0,1,2 and E262 has a value in it, and/or, when C247 = 0,1 and E262 & E257 has a value in it.

Thanks,
 
Upvote 0
Hi Scott,

Unfortunately this isn't what i am trying to get at.

I need the message to appear when C247 = 0,1,2 and E262 has a value in it, and/or, when C247 = 0,1 and E262 & E257 has a value in it.

Thanks,

What about negative numbers? if you say C247<2 then negative numbers or a blank cell will return true, is this what you want?
 
Upvote 0
I need the message to appear when C247 = 0,1,2 and E262 has a value in it, and/or, when C247 = 0,1 and E262 & E257 has a value in it.
Note that AND and OR have VERY different meanings, and it is important to fully understand which one you need.

Sounds like you want something like:
Code:
=IF(OR(AND(C247<=2,E262>0),AND(C247<=1,E262>0,E257>0)),[COLOR=#333333]"Please ensure all irrelevant options are blank","")[/COLOR]
 
Upvote 0
Did you try the solution I proposed?
Provided the information you posted in post #5 is accurate and complete, I believe it should do what you want.
 
Upvote 0

Forum statistics

Threads
1,215,045
Messages
6,122,836
Members
449,096
Latest member
Erald

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