我在excel 2010上遇到了问题:我想说
IF(G3 =" a" AND G2> 0)或if(G3 =" b" AND G2> 1)或if(G3 =" c&#34) ; AND G2> 2)或者如果(G3 =" d" AND G2> 3)那么"是"
我尝试过很多尝试来编写代码。有帮助吗? 以下是我要修复的代码:
=IF(OR(AND(G3="a",F3>=1)),(AND(G3="b",F3>1)),(AND(G3="c",F3>2)),"Yes")
答案 0 :(得分:1)
你有一些不匹配的括号。试试这个,而不是你拥有的。
=IF(OR(AND(G3="a",F3>=1),AND(G3="b",F3>1),AND(G3="c",F3>2)),"Yes")
此版本与您的报价相符。
=IF(OR(AND(G3="a",G2>0),AND(G3="b",G2>1),AND(G3="c",G2>2),AND(G3="d",G2>3)),"Yes")
答案 1 :(得分:1)
您可以将公式简化为:
=IF(AND(ISNUMBER(FIND(G3,"abcd")),F3>CODE(G3)-97),"Yes","No")
假设您提供的数据是简化的,这里是另一个使用INDEX,MATCH代替AND / OR的公式:
=IF(F3>IFERROR(INDEX({0,1,2,3},MATCH(G3,{"a","b","c","d"},0)),1E+99),"Yes","No")