A way to maintain cell references when doing dynamic running total

不打扰是莪最后的温柔 提交于 2021-01-05 10:57:40

问题


I have a running total of another dynamically generated column (I7:I). I computed it using mmult(). The only problem with this is using indirect means the references break if I move data around in my sheet say by adding or removing rows above 7. If I use I7:I as my reference, it says the resulting array is too large. Is there a better way of doing this?

=ArrayFormula( MMULT(TRANSPOSE((ROW(indirect("I7:I" & max(ArrayFormula(ROW(I6:I)*(I6:I <> "")))) )<=TRANSPOSE(ROW(indirect("I7:I" & max(ArrayFormula(ROW(I6:I)*(I6:I <> "")))) )))*indirect("I7:I" & max(ArrayFormula(ROW(I6:I)*(I6:I <> "")))) ),query(indirect("I7:I" & max(ArrayFormula(ROW(I6:I)*(I6:I <> "")))),  "select 1 label 1 ''"))) 

回答1:


try like this:

=ARRAYFORMULA(MMULT(
 TRANSPOSE((ROW(INDIRECT("I7:I"&MAX(ROW(I:I)*($I:$I<>""))))<=
 TRANSPOSE( ROW(INDIRECT("I7:I"&MAX(ROW(I:I)*($I:$I<>""))))))*
                INDIRECT("I7:I"&MAX(ROW(I:I)*($I:$I<>"")))),
          QUERY(INDIRECT("I7:I"&MAX(ROW(I:I)*($I:$I<>""))),  
 "select 1 label 1''")))



来源:https://stackoverflow.com/questions/57024291/a-way-to-maintain-cell-references-when-doing-dynamic-running-total

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!