google 工作表数组公式 sumifs 为数组中的所有值重复第一个值

google sheets array formula sumifs repeats first value for all values in array

我正在尝试做一个像 "Ben Collin's Tutorial" that adds more formulas down a column as values are added in an adjacent column. This works with if functions, sum, basic arithmetic etc. but with sumifs, the first value is repeated. There have been attempted solutions on before, but it relies on the keys to be as long as the display or it uses queries so that the columns have to be adjacent or well behaved. Really, the vocabulary and labels are sufficient or consistent enough to describe the problem with an example so I made one on google sheets 这样的表单自动完成公式。

e2中的公式为:

=arrayformula(if($A2:$A<>"",sumifs(data!C:C,data!A:A,$A2:$A,data!B:B,"k"),""))

如果结果是f列的结果就好了。我不知道后台发生了什么,所以这将是一个理想的结果,但我也试过了,但失败了。

=arrayformula(if(A2:A<>"",sumifs(data!C:C,data!A:A,A2:A,data!B:B,"k"),""))

=arrayformula(if(A:A<>"",sumifs(data!C:C,data!A:A,A:A,data!B:B,"k"),""))

可以这么说,$ 在这里不能像它们使用条件格式规则那样工作,这很遗憾。

尝试:

=ARRAYFORMULA(IFNA(VLOOKUP(A2:A, QUERY(data!A2:C, 
 "select A,sum(C) where B = 'k' group by A"), 2, 0)))