问题
The following is something I have tried after some research on nested IF's however it only gives expected results for the first part of the statement and not the remainder, can anyone explain why or do I need a different type of function?
=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"))))))))))
Thanks for your assistance.
回答1:
You have one if
if(g17>=500
and later on you have
if(g17>=750
The last condition will never be "satisfied", for if it is actually true, it will not be tested for, as the first if(g17>=500
will be True
.
I do not know what are the "expected results", "the first part of the statement", or "the remainder", but hopefully this helps.
回答2:
You can try this
=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"))))
回答3:
Thanks for the advice I do not think I explained myself too well, but in the end with some of the suggestions was able to work it out here is the finished formula:
=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")))))))))
来源:https://stackoverflow.com/questions/19911872/nested-if-statement