简体   繁体   English

IF AND陈述

[英]IF AND Statement

I have the following If statement which is working the way I want it too. 我有以下If语句,它也按我想要的方式工作。

However I need to add an extra condition where IF C7 has no data in it then it will show as 0. At the moment the cell the formula is in is showing #VALUE. 但是,我需要添加一个附加条件,如果IF C7中没有数据,则它将显示为0。此刻,公式所在的单元格中显示#VALUE。

I think that I will need to use IF(AND however my attempts have failed me. 我认为我将需要使用IF(并且但是我的尝试使我失败了。

=IF(C6="BT",12.88+(C7-30)*0.6,IF(C7<35,4.3,4.3+(C7-35)*0.2))

Thanks 谢谢

You could check for blanks first. 您可以先检查空白。

=If(c7="",0,IF(C6="BT",12.88+(C7-30)*0.6,IF(C7<35,4.3,4.3+(C7-35)*0.2)))

I just thought to add another approach I often use because I think it makes it easy to read is; 我只是想添加一种我经常使用的方法,因为我认为它易于阅读。

=If(c7="",0,1)*IF(C6="BT",12.88+(C7-30)*0.6,IF(C7<35,4.3,4.3+(C7-35)*0.2))

And there's another to skin this cat... 这只猫还有另一只皮...

=Iferror(IF(C6="BT",12.88+(C7-30)*0.6,IF(C7<35,4.3,4.3+(C7-35)*0.2)),0)

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

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