问题
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