简体   繁体   English

Excel嵌套IF语句

[英]Excel nested IF statement

=If(ISBLANK(F3),IF(F3<E3, ʺYesʺ, ʺNoʺ))

Have tried many iterations of this code to reach two outcomes on a stock order sheet. 尝试过多次重复执行此代码,以在库存订单上达到两个结果。

Result should return If Blank or cell difference is equal or greater than as "Yes" and "No" if smaller than. 如果空白或像元差等于或大于“是”,则结果应返回;如果小于或等于“否”,则应返回结果。

Any help is appreciated. 任何帮助表示赞赏。

Check your quotes. 检查您的报价。 Excel uses simple quotes " not ʺ. Excel使用简单的引号“而不是ʺ。

=If(ISBLANK(F3),IF(F3<E3, "Yes", "No"))

Instead of using ISBLANK(), use the following: 代替使用ISBLANK(),使用以下命令:

=IF(OR(F3="",F3>=E3),"No","Yes")

You have two options there as your question was not clear as to which cell was to be greater than or equal which. 您在那里有两个选择,因为您不清楚哪个单元格大于或等于哪个单元格的问题。

The reason you want to use the F3="" instead of ISBLANK(F3), is that if you have a formula in F3 that returns "" as a result, that is not the same as a blank cell. 您要使用F3 =“”而不是ISBLANK(F3)的原因是,如果F3中有一个公式返回结果“”,则该公式与空白单元格不同。 If you want to be safer, you may want to consider wrapping the first F3 in a CLEAN(TRIM(F3)) to remove when someone may have entered a space in the cell. 如果您想更加安全,则可以考虑将第一个F3包裹在CLEAN(TRIM(F3))中,以便在有人在单元格中输入空格后将其删除。

也许这样:

=IF(OR(ISBLANK(F13),F13<E13),"No","Yes")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM