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})
我想让这个公式判断两次,第一次:是否小于500.第二次,是否在500和2000之间。在第二次判断的时候,有没有"500<="的结果就不一样了
请问为什么B2单元格的结果和C2单元格的结果不一样呢?
辛苦!
不幸的是,我无法打开您的文件,标题是中文,并且不允许在我的工作站上打开。
如果有时间,我会在今晚去通知您。
如果我也建议您用英语写您的请求(如果您不会说英语,请使用Google翻译),这样您肯定会得到不仅仅是我的解决方案。
有关信息:
在这个论坛中,我们都是自愿参加的,也就是说,我们出于对人的善意的纯洁信念而提供帮助,为了得到帮助而提供帮助。
感谢您的耐心和时间,并很抱歉无法为您提供快速修复。
尼基利诺
我知道我什么都不知道(苏格拉底)
- lyt77-_Nov 23, 2020Copper Contributor
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!
- SergeiBaklanNov 23, 2020Diamond Contributor
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!