英文:
Drag down a sum formula but change column reference
问题
我试图拖动下一个求和公式,但是要更改列引用而不是行引用。
例如,单元格
E1 = 求和('Sheet2!C3:C)
E2 = 求和('Sheet2!D3:D)
E3 = 求和('Sheet2!E3:E)
有什么帮助吗?
英文:
I am trying to drag down a sum formula but change the column reference in stead of row reference.
For example cell
E1 =sum('Sheet2!C3:C)
E2 =sum('Sheet2!D3:D)
E3 =sum('Sheet2!E3:E)
Any help?
答案1
得分: 2
对于您分享的示例,请查看这是否有效(在单元格 E1 中)
=ArrayFormula(mmult(transpose(N(Sheet2!C3:E)), row(C3:C)^0))
更改范围以适应。此公式输出一个数组,因此不需要拖动下来。
英文:
For the example you shared, see if this works (in E1)
=ArrayFormula(mmult(transpose(N(Sheet2!C3:E)), row(C3:C)^0))
Change range to suit.
This formula outputs an array, so dragging down is not needed.
答案2
得分: 1
这里使用查询的公式,C和E可以更改为未来的实际范围:
= ARRAYFORMULA(QUERY(TRANSPOSE(QUERY(C3:E + 0, "SELECT " & JOIN(",", "SUM(Col" & COLUMN(C3:E3) - COLUMN(C3) + 1 & ")"))), "SELECT Col2"))
英文:
Here the formula that use query, C & E can be changed to future actual range:
= arrayformula(query(transpose(query(C3:E +0,"select " & join(",","sum(Col" & COLUMN(C3:E3)-Column(C3)+1 & ")") )),"Select Col2"))
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论