Forum Discussion
Philosopotamous
Apr 13, 2023Copper Contributor
Average of Every Nth Row Problem.
How do I display the average of the values from every 12 rows of column C starting from row 6? (I.e. rows 6, 18, 30, 42...) I want the average to be displayed in cell J6. I have tried to figu...
JosWoolley
Apr 14, 2023Iron Contributor
AVERAGE ignores blanks, so not sure you need the part (C6:C1000<>"")? Also, I find it's better to generalize these types of solutions, rather than make them row-dependent. For example, what if the OP changed the source range from C6:C1000 to, say, C4:C998? Would they necessarily know to change the 6 to a 4 for MOD?
As such, I would prefer
=AVERAGE(IF(MOD(ROW(C6:C1000)-MIN(ROW(C6:C1000)),12)=0,C6:C1000))
For interest's sake, for O365 we can also use a set-up without MOD:
=AVERAGE(TAKE(WRAPROWS(C6:C1000,12),,1))
Regards
HansVogelaar
Apr 14, 2023MVP
It first tried it without (C6:C1000<>""). Excel converted blanks to zeros that were included in the AVERAGE calculation, skewing the result.