如何使用 Excel 表格结构化引用创建运行总计? [英] How to create running total using Excel table structured references?
问题描述
我正在寻找一种使用 Excel 表结构化引用创建运行总计(当前行及以上行的总计)的方法.
I'm looking for a way to create a running total (total of the current row and above) using Excel table structured references.
我知道如何使用旧的基于行/列的方式来做到这一点:=SUM($A$2:$A2)
I know how to do it using the old row/column based way:
=SUM($A$2:$A2)
而且我知道如何使用结构化引用对整列进行总计:=SUM([WTaskUnits])
And I know how to total an entire column using structured references:
=SUM([WTaskUnits])
而且我知道如何使用 [#ThisRow]
获取当前单元格,但我不确定如何获取表格的第一行以在 SUM<中使用它/代码>.
And I know how to get the current cell using [#ThisRow]
, but I'm not sure how to get the first row of the table to use it in a SUM
.
推荐答案
实际上,我只是想出了一种使用 INDEX 的方法,但感觉应该有一种更结构化的参考方法.尽管如此,对于希望这样做的其他人来说,这就是我想出的:=SUM(INDEX([WTaskUnits],1):[[#This Row],[WTaskUnits]])
Actually, I did just figure out one way of doing it using INDEX, but feel like there should be a more structured reference way. Still, for others looking to do this here is what I came up with:
=SUM(INDEX([WTaskUnits],1):[[#This Row],[WTaskUnits]])
我使用 INDEX 来获取列的第一个单元格(在我的行/列示例中相当于 $A$2)并通常使用 [#This Row] 来获取当前行中的单元格(相当于我行中的 A2/列示例).
I use INDEX to get the first cell of the column (equivalent of $A$2 in my row/column example) and use [#This Row] normally to get the cell in current row (equivalent of A2 in my row/column example).
这篇关于如何使用 Excel 表格结构化引用创建运行总计?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!