Moving Average Column Last 3 Values

lynette1978

New Member
Joined
Aug 10, 2017
Messages
5
I'm trying to create a moving average so when I enter the values for each month, it averages the last 3 values in that row, even if the value for that month is zero (not blank). I'm not sure how to do this. The 3-Mo average would go in cell A2 and I would update the values in cells B2 through M2 for each month.

A
B
C
D
E
F
G
H
I
J
K
L
M
1
Moving Average
2016-10
2016-11
2016-12
2017-01
2017-02
2017-03
2017-04
2017-05
2017-06
2017-07
2017-08
2017-09
2
65,754
45,075
32,643
75,236
64,357
86,467
87,235
32,763
54,752
34,452

<tbody>
</tbody>
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
One possibility:
=IF(COUNTA(B2:M2)<3,"",(OFFSET(A2,0,COUNTA(B2:M2)-2) +OFFSET(A2,0,COUNTA(B2:M2)-1) +OFFSET(A2,0,COUNTA(B2:M2)))/3)

(There must surely be a more concise way)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,472
Messages
6,125,011
Members
449,204
Latest member
tungnmqn90

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