Problem with If Formula

microhunt

Board Regular
Joined
Aug 14, 2017
Messages
57
Office Version
  1. 2021
Platform
  1. Windows
I am using the following formula in cell A5. I would like if N5 is blank then A5 also return blank. If N5 is 0 or is greater than zero then equals K5. I am nearly there but cannot get the results I want

Here is the conditions for the formula.

Excel Formula:
=IF(OR(T5="FALSE",B5>0,N5>=0.01),K5,IF(OR(T5="TRUE",O5>0),K5,""))


If T4 is false and B4 or N4 is greater than zero or equal to then output "K4" If T4 is false and B4 and N4 or both blank then output nothing just blank.

If T4 is True and N4 or O4 is greater than zero or equal to then output "K4" If T4 is True and N4 and O4 or both blank then output nothing just blank.

Any help would be appreciated
 
=AND(T4=FALSE,OR(B4>=0,N4>=0))
What is the result - test with T4, B4 & N4

Tested if you toggle checkbox it goes from true to false, Nothing happens, However if you put quotes on the false you can toggle between True and false. Test with values in T4, B4 & N4, nothing happens

Excel Formula:
=AND(T4=TRUE,OR(N4>=0,O4>=0))
Nothing happens even if you toggle box,

However if you put quotes on the true you can toggle between True and false
Excel Formula:
=AND(T4="TRUE",OR(N4>=0,O4>=0))
However if you put quotes on the true you can toggle between True and false. Putting values in the cells T4, N4 & O4 makes no difference.
 
Upvote 0

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Excel Formula:
=IF(T4,IF(OR(AND(N4>=0,NOT(ISBLANK(N4))),AND(O4>=0,NOT(ISBLANK(O4)))),K4,IF(AND(ISBLANK(N4),ISBLANK(O4)),"","other condition")),IF(OR(AND(B4>=0,NOT(ISBLANK(B4))),AND(N4>=0,NOT(ISBLANK(N4)))),K4,IF(AND(ISBLANK(B4),ISBLANK(N4)),"","other condition")))
 
Upvote 0
Solution
My apologies, please ignore last reply as another cell was accidently deleted. I will retest now.
 
Upvote 0
Ok,

*JamesCanale

has replied with a good formula - a blank cell in a formula is often seen as zero
so Try that formula and if still not working correctly come back
 
Upvote 0
Thanks.

You also don't have to do if(T4="True",...) you can just do if(T4,...)

I put 'other condition' to account for the possibility of putting in negative numbers (which might never happen) in some of those cells.
 
Upvote 0
=AND(T4=TRUE,OR(N4>=0,O4>=0))
What is the result - test with T4, N4 & O4

Excel Formula:
=AND(T4=FALSE,OR(B4<=0,N4<=0))
I had to change to greater than < So if I enable T4 to true False is output in A4. I have to input values to both N4 and O4 before it will change to false
 
Upvote 0
so try the formula
=AND(T4=FALSE,OR(B4>=0,N4>=0))
What is the result - test with T4, B4 & N4

I had to change to greater than < So if I enable T4 to true False is output in A4. I have to input values to both B4 and N4 before it will change to false. Inputting zero in both does not do anything. The value stays at false. My cells are formatted to accounting £0.00 if I press delete then the cell is blank so I can't see this making any difference.
 
Upvote 0
=AND(T4=TRUE,OR(N4>=0,O4>=0))
What is the result - test with T4, N4 & O4

I had to change to greater than < So if I enable T4 to true, true is output in A4. I have to input values above zero to both N4 and O4 before it will change to false
 
Upvote 0
This is nearly perfect. The only problem is if you enter zero into either cell it does nothing.

Excel Formula:
=IF(OR(AND(T4=FALSE,AND( B4<=0,N4<=0)),AND(T4=TRUE,AND(N4<=0,O4<=0))),"private",K4)
 
Upvote 0
ok,
did you try

JamesCanale

formula

you said
B4 or N4 is greater than zero or equal to
NOW
AND( B4<=0,N4<=0)
Thats NOT an OR - both B4 AND N4
Also a blank cell as mentioned previously is seen as a zero and as posted by

JamesCanale

ISBLANK() will be used
 
Upvote 0

Forum statistics

Threads
1,214,919
Messages
6,122,259
Members
449,075
Latest member
staticfluids

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