Dynamic Table: Progressive Row SUM

epardo87

Board Regular
Joined
Feb 24, 2015
Messages
56
Hello there,
I have a table where each row is a different Date (Event) and each column contains different statistical data, what I want to do is to create a dynamic chart where each row adds up the data of the previous events, some columns can be a simple sum and others complex formulas, I can manage that, but what I haven't figure out is how to make each row grow... I leave this simple example here, I know how to do this with a simple spreadsheet and formulas for each cell but since the actual tables are huge, I would like to know if there is a way to do it through dynamic tables

So this is and idea of what I have, each row contains stats of that specific event
DateStat AStat BStat C (=A/B)
1/15100.50
1/24200.20
1/36150.40

What I expect to have is a table of progressive added up stats:
DateProgressive Stat AProgressive Stat BProgressive Stat C (=A/B)
1/15100.50
1/29300.30
1/315450.33

Thanks in advance for your time and advice

Regards!
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
This seems like it got more complicated than it should have. Assuming you have 365 (from your question wording)...
MrExcelPlayground14.xlsx
ABCDEFGHIJK
1DateStat AStat BStat C (=A/B)DateProgressive AProgressive BProgressive C
21-Jan5100.51/1/20225100.50
32-Jan4200.21/2/20229300.30
43-Jan6150.41/3/202215450.33
54-Jan2211/4/202217470.36
Sheet22
Cell Formulas
RangeFormula
H2:H5H2=Table2[Date]
I2:I5I2=LET(a,Table2[Stat A],b,SEQUENCE(1,ROWS(a),1,0),c,MMULT(a,b),d,SEQUENCE(ROWS(c),COLUMNS(c)),e,MOD(d-1,COLUMNS(d))+1,f,INT((d-1)/COLUMNS(d))+1,g,IF(e>=f,c,0),h,SEQUENCE(ROWS(d),1,1,0),MMULT(TRANSPOSE(g),h))
J2:J5J2=LET(a,Table2[Stat B],b,SEQUENCE(1,ROWS(a),1,0),c,MMULT(a,b),d,SEQUENCE(ROWS(c),COLUMNS(c)),e,MOD(d-1,COLUMNS(d))+1,f,INT((d-1)/COLUMNS(d))+1,g,IF(e>=f,c,0),h,SEQUENCE(ROWS(d),1,1,0),MMULT(TRANSPOSE(g),h))
K2:K5K2=I2#/J2#
D5D5=[@[Stat A]]/[@[Stat B]]
Dynamic array formulas.
 
Upvote 0
This seems like it got more complicated than it should have. Assuming you have 365 (from your question wording)...
MrExcelPlayground14.xlsx
ABCDEFGHIJK
1DateStat AStat BStat C (=A/B)DateProgressive AProgressive BProgressive C
21-Jan5100.51/1/20225100.50
32-Jan4200.21/2/20229300.30
43-Jan6150.41/3/202215450.33
54-Jan2211/4/202217470.36
Sheet22
Cell Formulas
RangeFormula
H2:H5H2=Table2[Date]
I2:I5I2=LET(a,Table2[Stat A],b,SEQUENCE(1,ROWS(a),1,0),c,MMULT(a,b),d,SEQUENCE(ROWS(c),COLUMNS(c)),e,MOD(d-1,COLUMNS(d))+1,f,INT((d-1)/COLUMNS(d))+1,g,IF(e>=f,c,0),h,SEQUENCE(ROWS(d),1,1,0),MMULT(TRANSPOSE(g),h))
J2:J5J2=LET(a,Table2[Stat B],b,SEQUENCE(1,ROWS(a),1,0),c,MMULT(a,b),d,SEQUENCE(ROWS(c),COLUMNS(c)),e,MOD(d-1,COLUMNS(d))+1,f,INT((d-1)/COLUMNS(d))+1,g,IF(e>=f,c,0),h,SEQUENCE(ROWS(d),1,1,0),MMULT(TRANSPOSE(g),h))
K2:K5K2=I2#/J2#
D5D5=[@[Stat A]]/[@[Stat B]]
Dynamic array formulas.
Thanks for your answer, I'm still trying to make your formulas work but haven't succeed, but before going further I have one question: I'm sorry for not bringing this up in the first place, but there is one other column I didn't mentioned for the sake of making the example simple, but each event (row) involves a different subject (from a limited group of subjects), if I filter this column per subject, will these formulas show the progressive calculation of that single subject?
Do you think this can be solved through a Pivot table?

DateSubjectStat AStat BStat C
 
Upvote 0
These formulas won't change if you change the filter. If you want that, then where it says
Table2[Stat A]
you'd have to wrap a FILTER around it. So FILTER(Table2[Stat A],Table2[otherfiltercolumn]=??)
One trick I often do, is to put a slicer on the table with that filter column that you are interested in, and then make another column with an AGGREGATE count or counta function that will ignore hidden rows and set it to look at a cell in its own row. Then filter out the 0's in the new aggregate column. So when you run the slicer, the hidden rows all get filtered out of your results. So something like a pivot table without the refreshing.
As far as unpacking the formulas in my LET - those MMULTs aren't intuitive. I'd look at each of the variables (a,b,c,...) to get a feel on how it's working. Mostly, I'm trying to create a 2D array that looks like 'g' in my let.
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,264
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top