|
用AND来减少IF的层数,把可以合并的条件并在一起.小弟写的一个公式,供参考.
IF(AND(IF(AND((COUNTIF($A2,"*"&"氨"&"*"))+(COUNTIF($A2,"*"&"弹"&"*")))=TRUE,"A","")="",IF(AND((COUNTIF($A2,"*"&"T/C"&"*"))+(COUNTIF($A2,"*"&"CVC"&"*"))+(COUNTIF($A2,"*"&"C"&"*"&"*"&"D"&"*"))+(COUNTIF($A2,"*"&"D"&"*"&"*"&"C"&"*")))=TRUE,"TC","")="",IF(AND((COUNTIF($A2,"*"&"R"&"*"))+(COUNTIF($A2,"*"&"N"&"*"))+(COUNTIF($A2,"A"&"*"))+(COUNTIF($A2,"涤锦网眼")))=TRUE,"Q","")=""),IF((COUNTIF($A2,"*"&"T"&"*"))=1,"T",IF((COUNTIF($A2,"*"&"C"&"*"))=1,"C","")),IF(IF(AND((COUNTIF($A2,"*"&"氨"&"*"))+(COUNTIF($A2,"*"&"弹"&"*")))=TRUE,"A","")="A","A",IF(IF(AND((COUNTIF($A2,"*"&"T/C"&"*"))+(COUNTIF($A2,"*"&"CVC"&"*"))+(COUNTIF($A2,"*"&"C"&"*"&"*"&"D"&"*"))+(COUNTIF($A2,"*"&"D"&"*"&"*"&"C"&"*")))=TRUE,"TC","")="TC","TC",IF(IF(AND((COUNTIF($A2,"*"&"R"&"*"))+(COUNTIF($A2,"*"&"N"&"*"))+(COUNTIF($A2,"*"&"A"&"*"))+(COUNTIF($A2,"涤锦网眼")))=TRUE,"Q","")="Q","Q","")))) |
|