Here is answer for all if needed, if you have by dates, old data up and new down, then average of first 10 items, can't be calculated in first 10 rows without issues where you have Average.
Here is solution for one way direction:
=IF(AND((ROW())>=11,L2<>""),AVERAGE(OFFSET(M2,-9,-1,10)),"")
What Offset does, is goes up +9 places from current cell M2, then it goes 1 cell left, and from there takes 10 down to mark the range.
IF if statement is wrong it doesn't go left and up, thus no error, after and including ROW 10 it's true statement.
And this is more complicated to use with Table in Excel, when you have sorting by date, when newest date is on top, bottom is data that you can use for average:
=IF($A$2>$A$3,AVERAGE(OFFSET(M2,0,-1,10)),IF(AND((ROW())>=11,L2<>""),AVERAGE(OFFSET(M2,-9,-1,10)),""))
I have first IF (A2>A3) that checks how is table sorted:
- if sorted newest - oldest (1st case) then it takes average from first row on the left, and down 10 places
- if sorted opposite, it goes as said: left one place, and up 9, then takes 10 range.
Works like a charm, bit long, but it works!