I have the following table below...
1D Spilled Range Formula (Rolling Average Staggering Array).png
The light blue shaded fields are manual inputs of historical data.
Columns "C" through "H" are calculated fields, as well as column "A" from the second month going forward.
I managed to come up with cascading/spill formulas for the following columns:
Month (cell A7):
=EOMONTH($A$6;ROW($B$7:$B$41)-ROW($B$6))
Δ% vs. prior month (cell C6):
=IF(ISNUMBER($B$5:$B$40)=TRUE;($B$6:$B$41/$B$5:$B$40)-1;"N/A ")
Δ% vs. 12 months prior (cell E6):
=IFS(EOMONTH(DATE(YEAR($A$6:$A$41);MONTH($A$6:$A$41)-11;DAY($A$6:$A$41)-11);0)=$A$6;$G$6#;EOMONTH(DATE(YEAR($A$6:$A$41);MONTH($A$6:$A$41)-12;DAY($A$6:$A$41)-12);0)<$A$6;"N/A ";TRUE;($B$6:$B$41/INDEX($A$6:$H$41;MATCH($A$6:$A$41;$A$6:$A$41;0)-12;MATCH($B$4;$A$4:$H$4)))-1)
Running Δ%, within year (cell G6):
=IF(ISNUMBER($B$5:$B$40)=TRUE;($B$6:$B$41/INDEX($A$6:$H$41;MATCH($A$6:$A$41;$A$6:$A$41;0)-MONTH($A$6:$A$41);MATCH($B$4;$A$4:$H$4;0)))-1;"N/A ")
Running Δ%, whole period (cell H6):
=IF(ISNUMBER($B$5:$B$40)=TRUE;($B$6:$B$41/$B$6)-1;"N/A ")
But I've been trying every trick in the book (at least the ones I know of) to come up with a cascading/spill formula solution for the rolling average columns ("D" and "F") to no avail.
It seems to me the issue at hand that prevents me from getting there is the fact that this calculation deals with 12-month arrays that not only are just a piece of their respective columns but they also stagger down the table...
The standard formulas are as per the following:
Rolling average vs. prior month (cell D6):
=IFERROR(IF(DATE(YEAR($A6);MONTH($A6)-12;DAY(EOMONTH($A6;-12)))<$A$6;"N/A ";AGGREGATE(1;6;OFFSET($A$1;ROW(INDEX($A$4:$H$41;MATCH($A6;$A$6:$A$41;0)-11;MATCH($C$4;$A$4:$H$4;0)));COLUMN($C$4)-1;12)));"N/A ")
Rolling average vs. 12 months prior (cell F6):
=IFERROR(IF(DATE(YEAR($A6);MONTH($A6)-23;DAY(EOMONTH($A6;-23)))<$A$6;"N/A ";AGGREGATE(1;6;OFFSET($A$1;ROW(INDEX($A$4:$H$41;MATCH($A6;$A$6:$A$41;0)-11;MATCH($E$4;$A$4:$H$4;0)));COLUMN($E$4)-1;12)));"N/A ")
Could anyone please shed a light here?
Leonardo
Bookmarks