Hi Jesper,
You can use the Summation function with an If() condition to do this.
Here's a picture of what it would look like in the formula editor.
And here's the text version:
Summation(
i = Row() - 7,
Row() + 7,
If( :DAY == :DAY
:DIAMETER,
.
)
) / Summation( i = Row() - 7, Row() + 7, If( :DAY == :DAY, 1, . ) )
Hope that helps.
-Jeff
-Jeff