简体   繁体   English

无法在Excel中修复此公式

[英]Not able to repair this formula in Excel

=IF(COUNTIF($E8:$E12+$G8:$M11,"A")+(COUNTIF($E8:$E12+$G8:$M11,"AH")/2)=0,"",COUNTIF($E8:$E12+$G8:$M11,"A")+(COUNTIF($E8:$E12+$G8:$M11,"AH")/2))

I am selecting some cells in Excel and I am calculating value A,AH based on those cells 我正在Excel中选择一些单元格,并根据这些单元格计算值A,AH

  • A means 1 均值1
  • AH means 0.5. AH表示0.5。

In theses cells $E8:$E12+$G8:$M11 I am caluclating A AH values in these cells 在这些单元格$ E8:$ E12 + $ G8:$ M11中,我正在计算这些单元格中的AH值

You cannot simply add ranges. 您不能简单地添加范围。 $E8:$E12+$G8:$M11 causes an error. $ E8:$ E12 + $ G8:$ M11导致错误。

If ranges F8:F12 and G12:M12 are empty and will always be empty you can simply use $E$8:$M$12 instead of $E8:$E12+$G8:$M11. 如果范围F8:F12和G12:M12为空,并且始终为空,则只需使用$ E $ 8:$ M $ 12而不是$ E8:$ E12 + $ G8:$ M11。 If this is not possible I would simply use a sum of COUNTIF functions, one for range $E8:$E12 and one for range $G8:$M11. 如果这不可能,我将简单地使用COUNTIF个函数的总和,一个用于范围$ E8:$ E12,另一个用于范围$ G8:$ M11。

Also you seem to have a problem of class =if(x=0,something,x) and x is always numeric. 您似乎也有类= if(x = 0,something,x)的问题,并且x始终是数字。 If x expression is lengthy, writing it twice might be difficult to read or play with. 如果x表达式很长,则可能很难读取或播放两次。 In such situations I sometimes use =iferror(1/(1/x),something). 在这种情况下,我有时会使用= iferror(1 /(1 / x),something)。 If x is zero then 1/x results in error, thus "something" is returned, if x is nonzero 1/(1/x) which is simply x is returned. 如果x为零,则1 / x导致错误,因此返回“某物”;如果x为非零,则返回简单的x / 1 /(1 / x)。

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

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