Reputation: 3
I have a basic understanding of excel formulas work and have used this site many times to broaden my knowledge, however, I'm stuck on the below and I'm hoping someone can assist me.
I'm trying to create a formula to work out if a KPI has been met. I have 3 separate formulas that I need to combine into one.
=IF(AND(E2="1",S2>0.041667),"YES","NO")
=IF(AND(E2="2",S2>0.125),"YES","NO")
=IF(AND(E2="3",S2>0.25),"YES","NO")
How do I do this?
Upvotes: 0
Views: 55
Reputation: 22866
A bit simplified with the CHOOSE
function (results in #VALUE!
error if E2
is not 1, 2, or 3) :
=IF(S2 > CHOOSE(E2, 0.041667, 0.125, 0.25), "YES", "NO")
Upvotes: 0
Reputation: 2392
I think you just need to use an OR
to combine them. See below:
=IF(OR(AND(E2="1",S2>0.041667), AND(E2="2",S2>0.125), AND(E2="3",S2>0.25)) ,"YES","NO")
The OR
requires at least one argument to be true, so the statement will evaluate to TRUE
if at least one of the the AND
statements returns true.
Upvotes: 2