嵌套公式中的IFERROR

时间:2017-01-28 05:01:12

标签: excel excel-formula

如果范围为空/空白,我的公式会给出#DIV/0。相反,我希望结果是“”或“0”。

=IFERROR("Total = $"&FIXED(SUBTOTAL(9,L3:L85),0,0)&" ≥ $10K Count = "&COUNTIF(L3:L85,">=10000"),"≥ $10K Count = 0")&" or "&FIXED(SUM(COUNTIF(L3:L502,">=10000")/COUNTA(L3:L502)*100),0)&"%"

有人可以建议如何改进配方吗?

1 个答案:

答案 0 :(得分:1)

公式的这一部分存在误差为零的风险:

COUNTIF(L3:L502,">=10000")/COUNTA(L3:L502)*100

所以你只需要将它包装在另一个IFERROR函数中:

IFERROR(COUNTIF(L3:L502,">=10000")/COUNTA(L3:L502)*100,0)

然后将其插入整个公式:

=IFERROR("Total = $"&FIXED(SUBTOTAL(9,L3:L85),0,0)&" ≥ $10K Count = "&COUNTIF(L3:L85,">=10000"),"≥ $10K Count = 0")&" or "&FIXED(SUM(IFERROR(COUNTIF(L3:L502,">=10000")/COUNTA(L3:L502)*100,0)),0)&"%"