Forum Discussion
AmyM-NirR
Jan 17, 2022Copper Contributor
Max Running average
Hi, Excel 365 user over here. I'm looking for a way to use dynamic array formulas to calculate the max of average sum, in one formula. Below is an example of max running average, where the average i...
- Jan 17, 2022
AmyM-NirR I've used LET, SEQUENCE, TRANSPOSE and MMULT to accomplish this particular task. Not very straight-forward but it works.
=LET( n, 4, array, myData, r, SEQUENCE(ROWS(array)), c, SEQUENCE(,ROWS(array)-n+1), mx, TRANSPOSE((r<=c+3)*(c<=r)), result, MMULT(mx,array)/n, result )File attached.
AmyM-NirR
Jan 17, 2022Copper Contributor
Brilliant!
A little bit messy, but it does the trick.
Thanks!
A little bit messy, but it does the trick.
Thanks!
SergeiBaklan
Jan 17, 2022Diamond Contributor
Similar variant
=MMULT( INDEX( myData, SEQUENCE( ROWS(myData) - 4 + 1) + SEQUENCE(,4,0) ), SEQUENCE(4,,1,0) ) / 4