嵌套的IF语句

时间:2013-11-11 17:03:44

标签: excel if-statement nested nested-if

以下是我在对嵌套IF进行一些研究后尝试过的事情,但是它只给出了语句第一部分的预期结果而不是剩余部分,任何人都能解释为什么或者我需要不同类型的函数吗?

=if(h4="basic","basic",if(g17>=500,"Standard",if(h4="standard","Standard",if(g17>=750,"Standard+",if(g17<=500,"Basic",if(h4="Standard+","standard+",If(g17<=750,"Standard",if(g17>=850,"Platinum",if(h4="Platinum","Platinum",if(g17<=850,"Standard+","Platinum"))))))))))

感谢您的协助。

3 个答案:

答案 0 :(得分:1)

如果

,你就有一个
if(g17>=500

以后你有

if(g17>=750

最后一个条件永远不会“满足”,因为如果它实际上是真的,它将不会被测试,因为第一个if(g17>=500将是True

我不知道“预期结果”,“声明的第一部分”或“其余部分”是什么,但希望这会有所帮助。

答案 1 :(得分:0)

你可以试试这个

=IFERROR( INDEX({"basic","Standard","Standard+","Platinum"},MATCH(H4,{"basic","Standard","Standard+","Platinum"},0)),IF(G17>850,"Platinum",IF(G17>750,"Standard+",IF(G17>500,"Standard","Basic"))))

答案 2 :(得分:0)

感谢您的建议我不认为我自己解释得太好了,但最后有一些建议能够解决这里完成的公式:

=IF(AND(H4="Basic",G17<450),"Basic",IF(AND(H4="Basic",G17>=450),"Standard",IF(AND(H4="Standard",G17<450),"Basic",IF(AND(H4="Standard",G17>449,G17<700),"Standard",IF(AND(H4="Standard",G17>=700),"Standard+",IF(AND(H4="Standard+",G17>699,G17<800),"Standard+",IF(AND(H4="Standard+",G17<700),"Standard",IF(AND(H4="Standard+",G17>=800),"Platinum",IF(AND(H4="Platinum",G17<800),"Standard+","Platinum")))))))))