Hello,
I have been trying to get this formula to work and excel wants to add * in the or logic.
I can't see where I have gone wrong.
=IF(OR(AND(B55="X",B56="s129AC",B57="s129AAJ") B57="s129 AD",B57="s129AE"),"Yes",IF(OR(AND(B55="Y",B57="s56D")B56="s56",B56="s56A"),"Yes",IF(OR(AND(B55="Z",B57="s99ABD")B56="s99ABA",B56="s99ABB(4)"),"Yes","No")))
Mel
Hello Melissa,
If you are able to provide a sample file it would be a lot easier for me and others to give some help.
Based on the formula you have give us here, it seems you have missed out some parts. As I don't know what result you are expecting it is tricky to give you a modified formula, so I try to point out via comments what errors I see.
Separated formula with colours to show where you start and end each function.
=IF(OR(AND(B55="X",B56="s129AC",B57="s129AAJ")B57="s129AD",B57="s129AE"),"Yes",
IF(OR(AND(B55="Y",B57="s56D")B56="s56",B56="s56A"),"Yes",
IF(OR(AND(B55="Z",B57="s99ABD")B56="s99ABA",B56="s99ABB(4)"),"Yes","No")))
Comments:
The first thing I notice is that you are missing a comma after closing each AND() function. Without this comma the OR() function is not able to resolve.
The logic in your formula is not consistent. For example, in your first IF statement you have declared that cell B55 must have text value X AND that cell B56 must have text value s129AC AND that cell B57 must have text value s129AAJ in order to get a TRUE result, while if that is not TRUE, you then only declare what value cell B57 should have. Perhaps this is in line what you want, but it looks inconsistent to me.
I am guessing now, but what I think you want in your first IF statement is that cell B55="X" AND cell B56="s129AC" AND that cell B57="s129AAJ" OR B57="s129AD" OR B57="s129AE". If this is so, then you should write your formula like below example (only one IF statement in this example).
=IF(
OR(
AND(B55="X",B56="s129AC",B57="s129AAJ"),
AND(B55="X",B56="s129AC",B57="s129AD"),
AND(B55="X",B56="s129AC",B57="s129AE")
),
"Yes","No")
Or you can write the formula like this.
=IF(
AND(B55="X",B56="s129AC",OR(B57="s129AAJ",B57="s129AD",B57="s129AE")),
"Yes","No")
I hope I was able to give some help and good luck with sorting out your formula so it will work for you.
Br,
Anders
Thanks Andres,
I got it to work using the following which looks to be inline what you suggested.
=IF(AND(B56="X",B57="s129AC",OR(B58="s129 AD",B58="s129AE",B58="s129AAJ")),"Yes",IF(AND(B56="Y",B58="s56D",OR(B57="s56",B57="s56A")),"Yes",IF(AND(B56="Z",B58="s99ABD",OR(B57="s99ABA",B57="s99ABB(4)",B57="s99ABG(3)")),"Yes","No")))
It does look inconsistent as the variables in B57 & B58 had different requirements based on B56
Mel
Hello Mel,
Great that you got it working.