Simon,
I started with your original formula
=IF(AND(C2="No Ops",G2="No Ops"),IF(OR(J5=2,L5=2,N5=2,R5=2,T5=2,V5=2),"",B31),IF(AND(C2="Line Off",G2="Line Off"),IF(OR(J5=2,L5=2,N5=2,R5=2,T5=2,V5=2),"",B31),IF(AND(C2="Line Off",G2="Line Off",),B31,""))),IF(AND(C2="No Ops",G2="No Ops",OR(D4="s",D4="sw")),"",B31),IF(AND(C2="Line Off",G2="Line Off",OR(D4="s",D4="sw")),"",B31),IF(AND(C2="No Ops",G2="Line Off",OR(D4="s",D4="sw")),"",B31),IF(AND(C2="No Ops",G2="Line Off",OR(D4="s",D4="sw")),"",B31)
First I re-formatted it to make it readable
=IF(AND(C2="No Ops",G2="No Ops"),IF(OR(J5=2,L5=2,N5=2,R5=2,T5=2,V5=2),"",B31
(AND(C2="Line Off",G2="Line Off"),IF(OR(J5=2,L5=2,N5=2,R5=2,T5=2,V5=2),"",B31),
IF(AND(C2="Line Off",G2="Line Off",),B31,""))),
IF(AND(C2="No Ops",G2="No Ops",OR(D4="s",D4="sw")),"",B31),
IF(AND(C2="Line Off",G2="Line Off",OR(D4="s",D4="sw")),"",B31),
IF(AND(C2="No Ops",G2="Line Off",OR(D4="s",D4="sw")),"",B31),
IF(AND(C2="No Ops",G2="Line Off",OR(D4="s",D4="sw")),"",B31)
From this I could see that you were testing C2 and G2 for all combinations of "No Ops" and "Line Off", so I could simplify that to just OR statements, and combine that with the D4 OR, so
IF(AND(C2="No Ops",G2="No Ops",OR(D4="s",D4="sw")),"",B31),
IF(AND(C2="Line Off",G2="Line Off",OR(D4="s",D4="sw")),"",B31),
IF(AND(C2="No Ops",G2="Line Off",OR(D4="s",D4="sw")),"",B31),
IF(AND(C2="No Ops",G2="Line Off",OR(D4="s",D4="sw")),"",B31)
can be simplified to
'test#2
AND(
OR(C2="No Ops",G2="No Ops",C2="Line Off",G2="Line Off"),
OR(D4="s",D4="sw")
)
Similalrly,
IF(AND(C2="No Ops",G2="No Ops"),IF(OR(J5=2,L5=2,N5=2,R5=2,T5=2,V5=2),"",B31
(AND(C2="Line Off",G2="Line Off"),IF(OR(J5=2,L5=2,N5=2,R5=2,T5=2,V5=2),"",B31),
IF(AND(C2="Line Off",G2="Line Off",),B31,"")))
can (just about) be simplified to
'test#1
AND(
OR(
AND(C2="No Ops",G2="No Ops"),
AND(C2="Line Off",G2="Line Off")
),
OR(J5=2,L5=2,N5=2,R5=2,T5=2,V5=2)
),
As you want either or of these conditions, and as both return blank or B31, they can then be ORed
=IF(OR(
test#1,
test#2
),
"",B31)
Which all combined gives us
=IF(OR(
AND(
OR(
AND(C2="No Ops",G2="No Ops"),
AND(C2="Line Off",G2="Line Off")
),
OR(J5=2,L5=2,N5=2,R5=2,T5=2,V5=2)
),
AND(
OR(C2="No Ops",G2="No Ops",C2="Line Off",G2="Line Off"),
OR(D4="s",D4="sw")
)
),
"",B31)
BTW, the formula in that exploded view can still be copied to the formula bar and it works fine.