I have a single cell array formula that evaluates to a 6x7 matrix of integers:
{46,59,0,0,0,0;46,59,68,35,0,0;46,59,0,0,0,0;46,59,68,35,29,7;46,0,0,0,0,0;46,59,68,35,0,0;46,0,0,0,0,0}
I'm looking for a way to convert the elements within each row to their running row totals:
{46,105,105,105,105,105;46,105,173,208,208,208;46,105,105,105,105,105;46,105,173,208,237,244;46,46,46,46,46,46;46,105,173,208,208,208;46,46,46,46,46,46}
(corrected per FlameRetired's feedback below, this row omitted in initial post by mistake)
I've tried a number of approaches to manipulate the array formula to produce this result, so far I've been unsuccessful.
...The SUBTOTAL and AGGREGATE functions are just returning #VALUE! errors. Presumably these only work on multi-cell arrays or array constants?
...I've tried to isolate the row values preceeding each element using INDEX, but can't seem to get the recursion to work correctly to sum them.
Any ideas? I'm stuck and not sure what approach to pursue next. Perhaps a VBA user-defined function that evaluates a two-dimensional array as input, loops through each element to produce a row subtotal at each position?
Maybe there is a mathematical way to do this that I'm overlooking? Some combination of matrix multiplication, division, transposition that will produce the cumulative row sums?
Thanks in advance for your help.
Bookmarks