Office中国论坛/Access中国论坛

标题: "if"函数在超过7层后应该如何应用 [打印本页]

作者: zqj_sh    时间: 2006-3-14 20:33
标题: "if"函数在超过7层后应该如何应用
"if"函数在超过7层后,应该加一个什么符号才能继续使用“if”函数
作者: ahng    时间: 2006-3-15 19:49
好像有人说过用名称定义的方法。
作者: zyz218    时间: 2006-3-15 22:39
Select case 好像没有层次限制,可能的话可以考虑
作者: succ41cn    时间: 2006-3-18 18:38
很期待有个可行的方法[em06]
作者: WGYE    时间: 2006-3-20 00:07
用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",""))))
作者: gybmyw407    时间: 2006-3-20 23:10
用VISUAL BASIC 编辑器方便多了,层多了用IF容易看花眼,用简单的函数编很快的,




欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3