google 表中行的可迭代求和?

Iterable Sum over row in google sheets?

我有 google 张数据,如下所示:

A B C D E F G
TP 14656 18885 14317 19312 13303 14311
FN 12216 20107 14066 16323 11180 3478

我想实现以下公式:

手动看起来像这样:

=(B1/(B1+B2))+(C1/(C1+C2))+...+(G1/(G1/G2))

但是,我需要这个公式是可扩展的。我尝试使用 ARRAYFORMULA 和 SERIESSUM 但无法设法实际遍历该行。工作表甚至支持这个吗?如果支持,工作表如何实现迭代求和?

您可以执行以下操作:

=Sum(ArrayFormula(B1:G1/(B1:G1+B2:G2)))

更新:

如果您希望范围依赖于手动输入的 j,请使用:

=Sum(ArrayFormula(Indirect("R1C2:"&"R1C"&j+1,0)/(Indirect("R1C2:"&"R1C"&j+1,0)+Indirect("R2C2:"&"R2C"&j+1,0))))

这假设您的 post 中的 table 从 A1 (R1C1) 开始。