Install free

Guides

Moving average in Google Sheets

A moving average smooths a series by averaging the latest few values. It is a simple way to see a trend through noise and to make a one-step-ahead forecast. Example: 18 months of product demand.

Run the Moving Average tool

  1. Open Extensions, StatPak, Data Analysis and choose Moving Average.
  2. Input range: the Demand column with its header, B1:B19. Tick Labels in first row.
  3. Interval: 3, the number of periods in each average.
  4. Tick Standard errors.
  5. Under Output choose Output range and pick C2, so each result lines up with its month. Click Run.
ABCD
1MonthDemandMoving averageStandard error
2Jan 2025120#N/A#N/A
3Feb 2025132#N/A#N/A
4Mar 2025128126.6667#N/A
5Apr 2025141133.6667#N/A
6May 2025150139.66677.356025
7Jun 20251381437.864595
8Jul 2025155147.66677.864595
9Aug 2025162151.66677.864595
10Sep 2025149155.33338.178563
11Oct 2025170160.33338.950481
12Nov 20251761659.211506
13Dec 2025168171.33338.670939
14Jan 20261811757.485789
15Feb 2026190179.66677.162143
16Mar 20261841856.922855
17Apr 2026197190.33337.123254
18May 2026205195.33336.804138
19Jun 2026199200.33336.823163

How to read the output

Choosing the interval

A longer interval smooths more but reacts more slowly. With an interval of 6 the June 2026 average is 192.6667 and the last standard error is 13.38981, against 200.3333 and 6.823163 with an interval of 3. Because this demand series has a steady upward trend, the longer average lags further behind. For monthly data with a yearly pattern, an interval of 12 removes the seasonal swings.

Excel's Moving Average dialog also has a Chart Output option. StatPak writes the numbers only; to chart them, select the Month, Demand and Moving average columns and choose Insert, Chart, Line chart.

With a formula

In C4 enter =AVERAGE(B2:B4) and fill down. The standard error in D6 is =SQRT(SUMXMY2(B4:B6, C4:C6) / 3), also filled down. These give the same values as the tool. If the series trends strongly, consider exponential smoothing or a regression on time, which follow a trend with less lag.

Related guides