Forum Discussion
为什么这么写if函数会出错
- Nov 23, 2020
lyt77-_ Condition in second IF always returns FALSE
500<=A2<2000 => TRUE<2000 => FALSE (logical value, as any text, always more than any number in logical operations)
Alternative formula:
=A2*LOOKUP(A2,{0,500,2000},{0,0.1,0.2})
I want this formula to judge twice, the first time: whether it is less than 500. The second time, whether it is between 500 and 2000. In the second judgment, the result of whether have "500<=" is different.Why is the result of cell B2 different from the result of cell C2?
I input 1200 into A2 and A3, input =IF(A2<500,0,IF(500<=A2<2000,A2*0.1,A2*0.2)) into B2,and the result is 240.
I input =IF(A3<500,0,IF(A3<2000,A3*0.1,A3*0.2)) into B3 and the result is 120.
I feel very sorry, I have to use Google Translate, the English translation may be a bit strange.
Thanks!
lyt77-_ Condition in second IF always returns FALSE
500<=A2<2000 => TRUE<2000 => FALSE (logical value, as any text, always more than any number in logical operations)
Alternative formula:
=A2*LOOKUP(A2,{0,500,2000},{0,0.1,0.2})
- lyt77-_Nov 24, 2020Copper ContributorThanks a lot! I understand.
Wish you no troubles in your life!- SergeiBaklanNov 24, 2020Diamond Contributor
lyt77-_ you are welcome and take care