SUMPRODUCT公式出现错误,公式解析错误。

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

SUMPRODUCT Formula is throwing an error Formula Parse Error

问题

我已经创建了以下公式,而不是使用 SUMIFS,因为数组在 Google SheetsSUMIFS 函数中不起作用,所以我使用了 Google 制作了这个公式,但我遇到了一个错误 Formula Parse Error

你的帮助将不胜感激。

=SUMPRODUCT(('3. Emp. Leave Setup'!B:B=B2:B)*('3. Emp. Leave Setup'!F:F>=DATEVALUE('Yearly Clndr'!E2:E))*('3. Emp. Leave Setup'!G:G<=DATEVALUE('Yearly Clndr'!F2:F)),'3. Emp. Leave Setup'!J:J*0)

以下是可以正常工作的 SUMIFS 公式,但无法将其转换为数组:

=SUMIFS('3. Emp. Leave Setup'!J:J,'3. Emp. Leave Setup'!B:B,B2,'3. Emp. Leave Setup'!F:F,">="&'Yearly Clndr'!E2,'3. Emp. Leave Setup'!G:G,"<="&'Yearly Clndr'!F2)
英文:

I have created below formula instead of SUMIFS because arrays do not work with Google sheets SUMIFS function so i used google to make this fomrula but i am getting an error Formula Parse Error

Your help will be much appreciated.

=SUMPRODUCT((&#39;3. Emp. Leave Setup&#39;!B:B=B2:B)*(&#39;3. Emp. Leave Setup&#39;!F:F&gt;=DATEVALUE(&#39;Yearly Clndr&#39;!E2:E))*(&#39;3. Emp. Leave Setup&#39;!G:G&lt;=DATEVALUE(&#39;Yearly Clndr&#39;!F2:F)),&#39;3. Emp. Leave Setup&#39;!J:J*0)

Here is SUMIFS formula which is working fine but unable to convert it into Arrays

=SUMIFS(&#39;3. Emp. Leave Setup&#39;!J:J,&#39;3. Emp. Leave Setup&#39;!B:B,B2,&#39;3. Emp. Leave Setup&#39;!F:F,&quot;&gt;=&quot;&amp;&#39;Yearly Clndr&#39;!E2,&#39;3. Emp. Leave Setup&#39;!G:G,&quot;&lt;=&quot;&amp;&#39;Yearly Clndr&#39;!F2)

答案1

得分: 1

为了获得逐行结果,每个值在范围B2:B10中产生一个结果,可以使用map(),如下所示:

=map( 
  B2:B10, 
  lambda( 
    value, 
    sumifs( 
      '3. Emp. Leave Setup'!J:J, 
      '3. Emp. Leave Setup'!B:B, value, 
      '3. Emp. Leave Setup'!F:F, ">=" & 'Yearly Clndr'!E2, 
      '3. Emp. Leave Setup'!G:G, "<=" & 'Yearly Clndr'!F2 
    ) 
  ) 
)
英文:

To get row-by-row results, one result per each value in the range B2:B10, use map(), like this:

=map( 
  B2:B10, 
  lambda( 
    value, 
    sumifs( 
      &#39;3. Emp. Leave Setup&#39;!J:J, 
      &#39;3. Emp. Leave Setup&#39;!B:B, value, 
      &#39;3. Emp. Leave Setup&#39;!F:F, &quot;&gt;=&quot; &amp; &#39;Yearly Clndr&#39;!E2, 
      &#39;3. Emp. Leave Setup&#39;!G:G, &quot;&lt;=&quot; &amp; &#39;Yearly Clndr&#39;!F2 
    ) 
  ) 
)

huangapple
  • 本文由 发表于 2023年2月8日 18:37:47
  • 转载请务必保留本文链接:https://go.coder-hub.com/75384548.html
匿名

发表评论

匿名网友

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

确定