Understanding a formula

Ian Betteridge

Active Member
Joined
Mar 25, 2006
Messages
472
Hello All,
I'm trying to understand a spreadsheet I'm working with and have come across quite a long formula. I'm sure broken down it can be explained as to what it's doing and what are the possible results. Here it is and this is how I think it should be split up..
If possible could someone please put me right and give a brief explanation on each step and its possible result.
Greatly Appreciated Ian

=IF(AND(OR(AND(O$20=TRUE,O41="x"),AND(P$20=TRUE,P41="x"),AND(Q$20=TRUE,Q41="x")),OR(AND(R$20=TRUE,R41="x"),AND(S$20=TRUE,S41="x"),AND(T$20=TRUE,T41="x"))),"Yes",IF(AND(OR(AND(O$20=TRUE,O41="z"),AND(P$20=TRUE,P41="z"),AND(Q$20=TRUE,Q41="z")),OR(AND(R$20=TRUE,R41="x"),AND(S$20=TRUE,S41="x"),AND(T$20=TRUE,T41="x"))),"Yes/No",IF(AND(OR(AND(O$20=TRUE,O41="x"),AND(P$20=TRUE,P41="x"),AND(Q$20=TRUE,Q41="x")),OR(AND(R$20=TRUE,R41="z"),AND(S$20=TRUE,S41="z"),AND(T$20=TRUE,T41="z"))),"Yes/No",IF(AND(OR(AND(O$20=TRUE,O41="z"),AND(P$20=TRUE,P41="z"),AND(Q$20=TRUE,Q41="z")),OR(AND(R$20=TRUE,R41="z"),AND(S$20=TRUE,S41="z"),AND(T$20=TRUE,T41="z"))),"Yes/No","No"))))

Broken down...........?
=IF(AND(OR(AND(O$20=TRUE,O41="x"),
AND(P$20=TRUE,P41="x"),
AND(Q$20=TRUE,Q41="x")),
OR(AND(R$20=TRUE,R41="x"),
AND(S$20=TRUE,S41="x"),
AND(T$20=TRUE,T41="x"))),"Yes",
IF(AND(OR(AND(O$20=TRUE,O41="z"),
AND(P$20=TRUE,P41="z"),
AND(Q$20=TRUE,Q41="z")),
OR(AND(R$20=TRUE,R41="x"),
AND(S$20=TRUE,S41="x"),
AND(T$20=TRUE,T41="x"))),"Yes/No",
IF(AND(OR(AND(O$20=TRUE,O41="x"),
AND(P$20=TRUE,P41="x"),
AND(Q$20=TRUE,Q41="x")),
OR(AND(R$20=TRUE,R41="z"),
AND(S$20=TRUE,S41="z"),
AND(T$20=TRUE,T41="z"))),"Yes/No",
IF(AND(OR(AND(O$20=TRUE,O41="z"),
AND(P$20=TRUE,P41="z"),
AND(Q$20=TRUE,Q41="z")),
OR(AND(R$20=TRUE,R41="z"),
AND(S$20=TRUE,S41="z"),
AND(T$20=TRUE,T41="z"))),"Yes/No",
"No"))))
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
With no context to the references, it would be impossible to explain this formulae, however, to understand it, you have already taken steps in this by breaking the formula down.

I would keep it in sections, eg.
=IF(AND(OR(AND(O$20=TRUE,O41="x"),AND(P$20=TRUE,P41="x"),AND(Q$20=TRUE,Q41="x")),OR(AND(R$20=TRUE,R41="x"),AND(S$20=TRUE,S41="x"),AND(T$20=TRUE,T41="x"))),"Yes"

IF(AND(OR(AND(O$20=TRUE,O41="z"),AND(P$20=TRUE,P41="z"),AND(Q$20=TRUE,Q41="z")),OR(AND(R$20=TRUE,R41="x"),AND(S$20=TRUE,S41="x"),AND(T$20=TRUE,T41="x"))),"Yes/No",

IF(AND(OR(AND(O$20=TRUE,O41="x"),AND(P$20=TRUE,P41="x"),AND(Q$20=TRUE,Q41="x")),OR(AND(R$20=TRUE,R41="z"),AND(S$20=TRUE,S41="z"),AND(T$20=TRUE,T41="z"))),"Yes/No",

IF(AND(OR(AND(O$20=TRUE,O41="z"),AND(P$20=TRUE,P41="z"),AND(Q$20=TRUE,Q41="z")),OR(AND(R$20=TRUE,R41="z"),AND(S$20=TRUE,S41="z"),AND(T$20=TRUE,T41="z"))),"Yes/No","No"

However, as the results for section 2, 3 and 4 give the same resuilt, it seems wholly over complicated.

HTH
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,290
Members
452,902
Latest member
Knuddeluff

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