Forum Discussion
Averaging data
I picked up on Wyn Hopkins problem and worked it through with dynamic arrays.
In place of helper ranges, I used named formulas for the block index b, a sequence index s within each block and weighting w of 1/N for the weighted sum of each block.
= SEQUENCE( QUOTIENT(ROWS(Amounts), N) )
= SEQUENCE(1, N)
= SEQUENCE(N,1,1,0) / N
Using these, I first turned the list into a crosstab
= INDEX( Amounts, s + N*(b-1) )
To average across each row requires MMULT [ this matrix multiplication is the only function that I know that will operate over the rows of a 2D array and return a column of results - Microsoft please do something about this! ]. This final step is achieved by nesting the crosstab to give the result
= MMULT( INDEX( Amounts, s + N*(b-1) ), w )
The output comprises the list of block numbers with the associated averages adjacent.