エクセル関数のエラーについて
エクセルの関数で間違っている箇所と解決策を教えて下さい。
下記【1】、【2】関数は正しく動いています。
【1】
IF(OR(AB21="err",AC21="err",AD21="err",AE21="err",AF21="err"),"err",IF(AND((OR(H21="SC",H21="CR",H21="A",H21="R",H21="CH")),(OR(AND(AE21="○",AF21="○"),AND(AD21="○",AF21="○"),AND(AC21="○",AF21="○"),AND(AB21="○",AF21="○")))),"(1)",IF(AND(OR(H21="MS",H21="AS",H21="BX"),AE21="×",AF21="○"),"(2)",IF(AND((OR(H21="MS",H21="AS",H21="BX")),(OR(AND(AD21="×",AE21="○",AF21="○"),AND(AD21="×",AE21="-",AF21="○")))),"(3)",IF(AND((OR(H21="MS",H21="AS",H21="BX")),(OR(AND(AD21="○",AE21="○",AF21="○"),AND(AD21="○",AE21="-",AF21="○"),AND(AD21="-",AE21="○",AF21="○"),AND(AD21="-",AE21="-",AF21="○")))),"(4)",IF(AG16="","(5)","err"))))))
【2】
AND((OR(H21="SC",H21="CR",H21="A",H21="R",H21="CH")),(OR(AND(AE21="×",AF21="○"),AND(AD21="×",AF21="○"),AND(AC21="×",AF21="○"),AND(AB21="×",AF21="○"))))
これを【1】関数の「AG16=""」箇所に【2】を入れたのが下記関数【3】ですが、これだとエラーになります。
【3】
IF(OR(AB21="err",AC21="err",AD21="err",AE21="err",AF21="err"),"err",IF(AND((OR(H21="SC",H21="CR",H21="A",H21="R",H21="CH")),(OR(AND(AE21="○",AF21="○"),AND(AD21="○",AF21="○"),AND(AC21="○",AF21="○"),AND(AB21="○",AF21="○")))),"(1)",IF(AND(OR(H21="MS",H21="AS",H21="BX"),AE21="×",AF21="○"),"(2)",IF(AND((OR(H21="MS",H21="AS",H21="BX")),(OR(AND(AD21="×",AE21="○",AF21="○"),AND(AD21="×",AE21="-",AF21="○")))),"(3)",IF(AND((OR(H21="MS",H21="AS",H21="BX")),(OR(AND(AD21="○",AE21="○",AF21="○"),AND(AD21="○",AE21="-",AF21="○"),AND(AD21="-",AE21="○",AF21="○"),AND(AD21="-",AE21="-",AF21="○")))),"(4)",IF(AND((OR(H21="SC",H21="CR",H21="A",H21="R",H21="CH")),(OR(AND(AE21="×",AF21="○"),AND(AD21="×",AF21="○"),AND(AC21="×",AF21="○"),AND(AB21="×",AF21="○"))))
,"(5)","err"))))))
原因と解決策(VBAは避けたいのですが・・・)を教えて頂けないでしょうか?
お礼
ご回答ありがとうございます。