PDA

View Full Version : COMBINE AND OR with IF Function in Single Formula



analyst
02-24-2014, 02:04 PM
My current Formula is as under


=IF(AND(Z6>=2.5,AA6>AA5,AA5>AA4),"New","Ignore")

Now, within same formula, if above condition is not met BUT following condition is true, then also, it should return, "New"

=IF(AND(Z6>=2.5,AA6>=AA4*0.90,"New", "Ignore")


So, if either of the condition is True, like

Condition 1) =IF(AND(Z6>=2.5,AA6>AA5,AA5>AA4),"New","Ignore")

OR

Condition 2) =IF(AND(Z6>=2.5,AA6>=AA4*0.90,"New", "Ignore")

Formula should return 'New', else 'Ignore'

How to combine two criteria AND OR with IF statement in single formula? Sample File attached.

Thanks

analyst
02-24-2014, 02:14 PM
I just tried this, I guess this is right!!!


=IF(AND(Z6>=2.5,OR(AA6>AA5,AA5>AA4),(AA6>=AA4*0.9)),"New","Ignore")

analyst
03-26-2014, 12:17 PM
I have two formula, which I require to merge to have one single formula:

Formula 1


=IF(AND(Z222>=5,(M222>=(M217*5)),(M222>=(M221*2)),K222>=50),Z222&" Shock","")

Formula 2


=IF(AND(K221>=50,(K222/K221)>=5),Z222&" Shock", "")

If either of the formula result is true, it should return value "Shock".

I tried different ways to put it in using IF, AND OR but no success......somewhere I'm making logical error, kindly correct/help me.

analyst
03-26-2014, 04:50 PM
To combine above formula, I am trying following which gives error


IF(OR(AND(Z222>=5,(M222>=(M217*5)),(M222>=(M221*2)),K222>=50),((K221>=50),((K222/K221)>=5))),Z222&" Shock","")

analyst
03-26-2014, 05:17 PM
Got the solution, was not properly put the brackets

the solution is like


=IF(OR(AND(Z222>=5,(M222>=(M217*5)),(M222>=(M221*2)),K222>=50),AND(((K221>=50)),((K222/K221)>=5))),Z222&" Shock","")