我有一个如下所示的 Excel 列:
H
2 =SUM(C2:D32) // 1st month expenses
3 =SUM(C33:D63) // 2nd month expenses
4 =SUM(C64:D94) // 3rd month expenses
5 =SUM(C95:D125) // 4th month expenses
...
如果我将单元格复制并粘贴H5
到H6
,那么我会得到:
H
...
6 =SUM(C96:D126) // not what I want
...
但相反,我希望第 6 行是=SUM(C126:D156)
。我怎样才能自动执行此操作,而不是手动输入范围?
答案1
使用 INDEX() 设置范围,将其放入 H2:
=SUM(INDEX(C:C,2+(Row(1:1)-1)*31):INDEX(D:D,32+(Row(1:1)-1)*31))
复制/拖拽