SUMIFS函数未按预期运行。

huangapple go评论73阅读模式
英文:

SUMIFS FUNCTION not functioning as expected

问题

这个数组公式(在单元格 H1 中)未能产生按月份显示总收入的缩进结果的原因是什么?

={"总收入";ARRAYFORMULA(if(G2:G<>"",sumifs(D2:D,C2:C,G2:G,B2:B,">0"),))}

我尝试根据另一个网站上找到的解决方案更改了公式的语法,但没有成功。

={"总收入";ARRAYFORMULA(if(G2:G<>"",sumif(C2:C&B2:B,G2:G&">0",D2:D),))}
英文:

What's the reason this array formula (in cell H1) is not producing the indented result of showing the total revenue per month?

={&quot;Total Revenue&quot;;ARRAYFORMULA(if(G2:G&lt;&gt;&quot;&quot;,sumifs(D2:D,C2:C,G2:G,B2:B,&quot;&gt;0&quot;),))}

SUMIFS函数未按预期运行。

I tried changing the syntax of the formula as per solution I found on another site to no avail.

={&quot;Total Revenue&quot;;ARRAYFORMULA(if(G2:G&lt;&gt;&quot;&quot;,sumif(C2:C&amp;B2:B,G2:G&amp;&quot;&gt;0&quot;,D2:D),))}

答案1

得分: 2

SUMIFS已经是一个数组公式,这就是为什么它无法准确检测你正在尝试做什么,哪些值应该被视为每行的个体。你可以使用BYROW,每次将月份的值作为输入:

={"总收入";BYROW(G2:G, LAMBDA(each, IF(each<>"", SUMIFS(D2:D, C2:C, each, B2:B, ">0"), )))}
英文:

SUMIFS is already an arrayformula, that's why it won't be able to detect exactly what you're trying to do, which values to consider as individual each row. You can use BYROW taking the values of months as input each time:

={&quot;Total Revenue&quot;;BYROW(G2:G,LAMBDA(each,if(each&lt;&gt;&quot;&quot;,sumifs(D2:D,C2:C,each,B2:B,&quot;&gt;0&quot;),)))}

huangapple
  • 本文由 发表于 2023年1月9日 06:23:55
  • 转载请务必保留本文链接:https://go.coder-hub.com/75051685.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定