Forum Discussion
Greg Bonaparte
Feb 09, 2019Iron Contributor
Perplexed!! Why does this not work? "OR" criteria added to a working formula
I'm not getting an error, I'm just not getting many results. I suspect its because of my greater than or less than zero requirements. The cells that contain the requirements are percentages so 1.0 is...
- Feb 09, 2019
Sorry, it excludes it if OR condition. To exclude from AND it could be like
=IF(AND( IF($D21>0,$AB30<$AC30,1), IF($F21>0,$AD30<$AE30,1), IF($H21>0,$AF30<$AG30,1), IF($J21>0,$AH30<$AI30,1), $AJ30<$AK30, $AL30<$AM30, $AN30<$AO30, $AP30<$AQ30), $Q30/$P30,"")
If D21 is negative first IF returns TRUE independently of what is in AB30 and AC30 and that doesn't affect other conditions under AND. Please see attached.
SergeiBaklan
Feb 09, 2019Diamond Contributor
Hi Greg,
Depend on what is the logic behind. In your formula OR conditions are nested under AND conditions, like
=IF(AND(cond1,cond2,OR(cond3,cond4)), result, "")
Is that what you'd like to achieve? Or
=IF( OR(AND(cond1, cond2), AND(cond3, cond4)), result, "")
- Greg BonaparteFeb 09, 2019Iron ContributorYes