Help creating a moving average function

felpslima

New Member
Joined
Sep 16, 2010
Messages
11
Hi there, I was wondering if anyone could help me build the following:

I have a whole lot of data on column b, I want moving averages in column c.
in cell d3 I would like to tell this functions how many rows to select below the active B cell needs to be analysed in that average.

as in

active cell: b2 -> the value in d3 is 5 then the function analyses the average of the range (b2:b7)
If d3 is 6, the te function analyses the average of the range (b2:b8)

can anyone help me?

Tthanks!
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Hi there, I was wondering if anyone could help me build the following:

I have a whole lot of data on column b, I want moving averages in column c.
in cell d3 I would like to tell this functions how many rows to select below the active B cell needs to be analysed in that average.

as in

active cell: b2 -> the value in d3 is 5 then the function analyses the average of the range (b2:b7)
If d3 is 6, the te function analyses the average of the range (b2:b8)

can anyone help me?

Tthanks!
What do you mean by "active cell" ?

If that starting cell is B2 and you enter 5 in D3 shouldn't the range to average be B2:B6?

B2 = 1
B3 = 2
B4 = 3
B5 = 4
B6 = 5
 
Upvote 0
Yes, you're right! b2:b6 is what I meant.

can you help me?
Try this...

=AVERAGE(B2:INDEX(B2:B1000,D3))

Adjust for the correct end of range.

Note that if D3 is an empty cell the formula will calculate the entire range.
 
Upvote 0

Forum statistics

Threads
1,224,537
Messages
6,179,408
Members
452,912
Latest member
alicemil

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