How to automatically create a 12 months continuing rolling average

Corried

Board Regular
Joined
Dec 19, 2019
Messages
217
Office Version
  1. 2019
Platform
  1. Windows
  2. Web
As date comes in. How can I have a continuous rolling moving average from the last cell, going forward?

See my error below on cell "D"
How can fix this?

This in advance.

x.PNG
 
12/1/2018​
51.50​
-0.10​
50.51​
1/1/2019​
48.50​
-3.00​
50.42​
2/1/2019​
49.50​
1.00​
50.61​
3/1/2019​
48.90​
-0.60​
50.73​
4/1/2019​
51.00​
2.10​
50.96​
5/1/2019​
50.80​
-0.20​
50.96​
6/1/2019​
49.20​
-1.60​
50.98​
7/1/2019​
51.50​
2.30​
51.34​
8/1/2019​
50.30​
-1.20​
51.30​
9/1/2019​
50.90​
0.60​
51.63​
10/1/2019​
51.10​
0.20​
52.00​
11/1/2019​
52.90​
1.80​
52.90​
 
Upvote 0

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
The formula posted does a rolling average as I stated based on column C. If it needs to be B then change all the C's to B's.
The formula will drag down if you increase the 64 to a higher number than you ever need as long as you don't put the date in column A in advance (as I have already stated).

What are the column letters for each column in the table that you have posted in post number 11 and what are the row numbers that you are showing (it really would be better if you used XL2BB)?

Please note that the numbers in your sample in column E (E at a guess) do not match a rolling year based on the data shown (the first line would be 51.50) so I am guessing that there were more dates within a year above the data shown.

Table below based on my guesses below and with the last date changed so it is more than 1 year from the first date (please note that my dates are in dd/mm/yyyy format). Manually done Average formula in column F to test results.

Dates in Column B, Column being averaged Column C and result in Column E. Upper range increased to row 154.

Book1
BCDEF
4301/12/201851.5-0.151.551.5
4401/01/201948.5-35050
4501/02/201949.5149.8333333349.83333333
4601/03/201948.9-0.649.649.6
4701/04/2019512.149.8849.88
4801/05/201950.8-0.250.0333333350.03333333
4901/06/201949.2-1.649.9142857149.91428571
5001/07/201951.52.350.112550.1125
5101/08/201950.3-1.250.1333333350.13333333
5201/09/201950.90.650.2150.21
5301/10/201951.10.250.2909090950.29090909
5401/01/202052.91.850.4181818250.41818182
Sheet1
Cell Formulas
RangeFormula
E43:E54E43=AVERAGEIFS($C$43:$C$154,$B$43:$B$154,"<="&$B43,$B$43:$B$154,">="&DATE(YEAR($B43)-1,MONTH($B43),DAY($B43)))
F43:F53F43=AVERAGE($C$43:$C43)
F54F54=AVERAGE($C$44:$C54)
 
Last edited:
Upvote 0
Book1
ABCDE
1CountryColumn1LastChange12 Mth Rolling Avg.
28/1/201550.10
3Colombia9/1/201550.00-0.10
4Colombia10/1/201551.601.6051.86
5Colombia11/1/201552.200.6051.75
6Colombia12/1/201553.501.3051.61
7Colombia1/1/201654.300.8051.37
8Colombia11/19/202052.90-1.4051.05
93/1/201652.10-0.8050.75
104/1/201651.20-0.9050.51
115/1/201650.90-0.3050.19
126/1/201650.40-0.5049.73
137/1/201650.700.3049.38
148/1/201650.40-0.3049.00
159/1/201652.101.7048.63
1610/1/201650.30-1.8048.32
1711/1/201650.500.2048.23
1812/1/201650.600.1048.03
191/1/201750.50-0.1047.88
202/1/201749.30-1.2047.59
213/1/201749.20-0.1047.63
224/1/201747.40-1.8047.75
235/1/201745.40-2.0048.14
246/1/201746.100.7048.62
257/1/201746.200.1049.19
268/1/201746.00-0.2049.80
279/1/201748.302.3050.41
2810/1/201749.301.0050.78
2911/1/201748.10-1.2051.01
3012/1/201748.800.7051.30
311/1/201847.00-1.8051.53
322/1/201849.702.7051.65
333/1/201850.701.0051.63
344/1/201852.101.4051.48
355/1/201851.10-1.0051.39
366/1/201853.001.9051.37
377/1/201853.500.5051.05
388/1/201853.30-0.2050.88
399/1/201852.80-0.5050.63
4010/1/201852.00-0.8050.48
4111/1/201851.60-0.4050.40
4212/1/201851.50-0.1050.51
431/1/201948.50-3.0050.42
442/1/201949.501.0050.61
453/1/201948.90-0.6050.73
464/1/201951.002.1050.96
475/1/201950.80-0.2050.96
486/1/201949.20-1.6050.98
497/1/201951.502.3051.34
508/1/201950.30-1.2051.30
519/1/201950.900.6051.63
5210/1/201951.100.2052.00
5311/1/201952.901.8052.90
Colombia
Cell Formulas
RangeFormula
D3, D4:D53D3=C3-C2
E4:E53E4=AVERAGE(C4:C15)
 
Upvote 0
.Not sure if you are reject my plead. Please view the true excel worksheet below. I am having some challenges on getting around this.
 
Upvote 0
So judging by cell E4's you are looking for 1 year (actually 11 months not 1 year) after the date in C4 not the previous year... correct?
and why are you counting 11/19/2020 in your Average formula (cell B8)?
Your results in your table with the exception of where you have the 11/19/2020 affecting the result are correct. If you correct the offending cell to 2/1/2016 then it is all correct (obviously my dates below are in dd/mm/yyyy format.
Book1
ABCDEF
1CountryColumn1LastChange12 Mth Rolling Avg.
201/08/201550.1051.65833333
3Colombia01/09/201550.00-0.151.68333333
4Colombia01/10/201551.601.651.8583333351.85833333
5Colombia01/11/201552.200.651.7551.75
6Colombia01/12/201553.501.351.6083333351.60833333
7Colombia01/01/201654.300.851.3666666751.36666667
8Colombia01/02/201652.90-1.451.0551.05
901/03/201652.10-0.850.7550.75
1001/04/201651.20-0.950.5083333350.50833333
1101/05/201650.90-0.350.1916666750.19166667
1201/06/201650.40-0.549.7333333349.73333333
1301/07/201650.700.349.37549.375
1401/08/201650.40-0.34949
1501/09/201652.101.748.6333333348.63333333
1601/10/201650.30-1.848.3166666748.31666667
1701/11/201650.500.248.2333333348.23333333
1801/12/201650.600.148.0333333348.03333333
1901/01/201750.50-0.147.8833333347.88333333
2001/02/201749.30-1.247.5916666747.59166667
2101/03/201749.20-0.147.62547.625
2201/04/201747.40-1.847.7547.75
2301/05/201745.40-248.1416666748.14166667
2401/06/201746.100.748.6166666748.61666667
2501/07/201746.200.149.1916666749.19166667
2601/08/201746.00-0.249.849.8
2701/09/201748.302.350.4083333350.40833333
2801/10/201749.30150.7833333350.78333333
2901/11/201748.10-1.251.0083333351.00833333
3001/12/201748.800.751.351.3
3101/01/201847.00-1.851.52551.525
3201/02/201849.702.751.6551.65
3301/03/201850.70151.6333333351.63333333
3401/04/201852.101.451.4833333351.48333333
3501/05/201851.10-151.3916666751.39166667
3601/06/201853.001.951.3666666751.36666667
3701/07/201853.500.551.0551.05
3801/08/201853.30-0.250.8833333350.88333333
3901/09/201852.80-0.550.6333333350.63333333
4001/10/201852.00-0.850.47550.475
4101/11/201851.60-0.450.450.4
4201/12/201851.50-0.150.5083333350.50833333
4301/01/201948.50-350.4181818250.41818182
4401/02/201949.50150.6150.61
4501/03/201948.90-0.650.7333333350.73333333
4601/04/201951.002.150.962550.9625
4701/05/201950.80-0.250.9571428650.95714286
4801/06/201949.20-1.650.9833333350.98333333
4901/07/201951.502.351.3451.34
5001/08/201950.30-1.251.351.3
5101/09/201950.900.651.6333333351.63333333
5201/10/201951.100.25252
5301/11/201952.901.852.952.9
Sheet1
Cell Formulas
RangeFormula
D3, D4:D53D3=C3-C2
F2:F3, F4:F53F2=AVERAGEIFS($C$2:$C$154,$B$2:$B$154,">="&B2,$B$2:$B$154,"<"&DATE(YEAR(B2),MONTH(B2)+11,DAY(B2))+1)
E4:E53E4=AVERAGE(C4:C15)
 
Last edited:
Upvote 0
MARK858
Thanks for your reply.

The code works wonderful. I appreciate your time and effort in getting my problem solved.

Thanks again
 
Upvote 0
That sounds like you should use the formula =AVERAGE(C43:D53) in D53
Then when you add 1/1/2020 in B54 and drag the formula down, it will become =AVERAGE(C44:D54).
 
Upvote 0
I agree totally with Mike. If your entries are consistently always 1 per month as per your posted data you should be using the simpler and more efficient Average formula.
 
Upvote 0

Forum statistics

Threads
1,224,829
Messages
6,181,219
Members
453,024
Latest member
Wingit77

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