我目前正在使用Google表格。假设:
对于单元格A10,我想根据我的“参考单元格”中的值求和上述x单元格。
我该怎么做?
如果从顶部尝试这样:
=SUM(INDIRECT("C1:C"&C10))
如果从底部开始:
=SUM(INDIRECT("C"&ROW()-1-C10&":C"&ROW()-1))
如果从底部开始,在A10中:
=sum(A9:offset(A10,-C10 ,0))
如果从顶部开始,在A10中:
=sum(A1:offset(A1,C10-1 ,0))
或从顶部:
=INDEX(QUERY(QUERY(C1:C9, "limit "&C10), "select sum(Col1)"), 2)
和底部:
=INDEX(QUERY(QUERY(C1:C9, "offset "&9-C10), "select sum(Col1)"), 2)
从顶部:
=SUM(QUERY(C1:C9, "limit "&C10))
自下而上:
=SUM(QUERY(C1:C9, "offset "&9-C10))