Filling series with averge function of cell blocks

Prevost

Board Regular
Joined
Jan 23, 2014
Messages
198
Hi There. I need to take the average of cells in column A, but I need to take them for rows 1-5, 6-10, 11-15....etc. Does anyone know how I can quickly do this with a fill? Or a work around for this? I tried manually typing in for a few cells AVERAGE(A1:A5) then AVERAGE(A6:A10) and so on but it doesn't seem to work. Does anyone have any ideas? Thanks!
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Excel 2012
ABC
1439242
2306254.8
3176361.2
4107400.4
5182
6191
7141
8285
9458
10199
11236
12261
13483
14335
15491
16290
17490
18478
19482
20262
Sheet1
Cell Formulas
RangeFormula
C1=AVERAGE(OFFSET($A$1,(5*ROW())-5,0,5,1))
C2=AVERAGE(OFFSET($A$1,(5*ROW())-5,0,5,1))
C3=AVERAGE(OFFSET($A$1,(5*ROW())-5,0,5,1))
C4=AVERAGE(OFFSET($A$1,(5*ROW())-5,0,5,1))
 
Upvote 0
Thank you. Can you please explain the formula? This is what I need, I just would like a better understanding and how to make it work for different rows and columns...Thanks!
 
Upvote 0
The offset() function has 5 arguments:
1) Your Base Cell (reference)
2) The number of rows you wish to move (Either up(-) or down(+)
3) The number of columns you wish to move (Either left (-) or right(+)
Optional:
4) The row size (#) of the range of cells you wish to capture
5) The column size (#) of the range of cells you wish to capture

Hope that helps, also see the HELP info on the OFFSET() function...
 
Upvote 0
Hello, adding onto what prevost asked, what if I want to average starting from arbitrary row? For example, if the A column extended out to 20000 and I wanted to start from row 13771 averaging the first 50 rows, in 900 row increment. So the first average would be E13771:E13820 and then next average would be E14671:E14720 and so on. Would the formula be "=AVERAGE(OFFSET($A$13771,(900+ROW()+0,0,50,1))"? I've tried it and it didn't work. Any help would be appreciated!
 
Upvote 0
[TABLE="width: 792"]
<tbody>[TR]
[TD]Into a column of your choice (Any Column Other Than Column E) but definitely on Row 13771 enter:

Code:
=IF(AND(MOD(ROW()+900-13771,900)=0,ROW()-ROW()<=50),AVERAGE(OFFSET($E13771,0,0,50,1)),"")

and Copy Down to Row 20,000
[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
Thanks!! The formula did work and I can follow it, but I have to ask, is there a way in which I can put all averages in a series of subsequent rows? so F13771 would have average(e13771:e13820) and F13772 would have average(e14671:e14720) and so on. I've been trying to find a way to automated addition to the index of the range of averages by 900, but have been failing to do so.
 
Upvote 0
In Cell F13771 enter

Code:
=AVERAGE(OFFSET($E$13771,900*(ROW()-13771),0,50,1))

and Copy Down several rows...
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,260
Members
452,627
Latest member
KitkatToby

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top