通过不运行相同的计算两次,使Excel公式更有效

发布于 2025-01-24 17:34:56 字数 256 浏览 2 评论 0原文

我试图通过不重复自己的效率使一个矮胖的工作表更加有效。我有使用sumif(s)值的圆形公式,但仅当其非零时。因此,它们是这样写的: = if(sumif(table1 [account],[@account],table1 [muthate_val])) 因此,从本质上讲,我的公式sumif(x),如果不是0,则是sumif(x)。在一个公式中,这是两次相同的工作。无论如何是否可以简化节省资源? 我想我可以在VBA中创建自定义功能,但是我需要的时间和变化似乎过多。

I'm trying to make a formula-heavy worksheet more efficient by not repeating itself. I have circular formulas where I use a SUMIF(S) value, but only if its non-zero. So they are written as such:
=IF(SUMIF(Table1[ACCOUNT],[@ACCOUNT],Table1[ACTUAL_VAL])<>0,SUMIF(Table1[ACCOUNT],[@ACCOUNT],Table1[ACTUAL_VAL]),"")
So essentially I'm having the formula SUMIF(X) and if not 0, then SUMIF(X). It's the same work twice within that one formula. Is there anyway to streamline that to save on resources?
I suppose I could create custom functions in VBA, but the amount of times and variations I'd need for that seems excessive.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

他是夢罘是命 2025-01-31 17:34:56

那里有一个副本,但我找不到。

使用倒数的倒数:

=IFERROR(1/(1/SUMIF(Table1[ACCOUNT],[@ACCOUNT],Table1[ACTUAL_VAL])),"")

使用Office 365,我们可以使用以下方式:

=LET(x,SUMIF(Table1[ACCOUNT],[@ACCOUNT],Table1[ACTUAL_VAL]),IF(x=0,"",x))

如@GSerg所述(对不起,当您看到您的评论时输入了)

There is a duplicate out there but I could not find it.

use the reciprocal of the reciprocal:

=IFERROR(1/(1/SUMIF(Table1[ACCOUNT],[@ACCOUNT],Table1[ACTUAL_VAL])),"")

With Office 365 we can use LET:

=LET(x,SUMIF(Table1[ACCOUNT],[@ACCOUNT],Table1[ACTUAL_VAL]),IF(x=0,"",x))

As @GSerg stated(sorry was typing when saw your comment)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文