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...
HansVogelaar
Apr 13, 2023MVP
Formula:
=AVERAGE(IF((MOD(ROW(C6:C1000),12)=6)*(C6:C1000<>""),C6:C1000))
- If your data extend below row 1000, adjust the ranges in the formula; it doesn't matter if the data range is smaller.
- If you don't have Microsoft 365 or Office 2021, confirm the formula by pressing Ctrl+Shift+Enter.
Philosopotamous
Apr 17, 2023Copper Contributor
I've been looking at the code trying to understand how it works. I understand the MOD function and Row, but I'm confused at what is happening in the IF function.
What is being multiplied? Is this a test of if the row is blank for the purpose of the AVERAGE function?