Moving Average Formula: Definition and Examples
The moving average formula is the sum of the last N data points divided by N. For a 3-month moving average, add three months of values and divide by three. Each new period drops the oldest value and adds the newest, so the average "moves" forward. It smooths noise to reveal the underlying trend.
- Simple moving average (SMA) = sum of the last N values ÷ N. N is the window, such as 3, 6 or 12 periods.
- Weighted moving average (WMA) multiplies each value by a weight and divides by the sum of weights, so recent periods count more.
- The moving average lags the trend by roughly (N − 1) ÷ 2 periods, so a 12-month window reacts slowly.
- It only smooths; it does not forecast. For projections, combine it with growth assumptions.
- Pick the window to match your cycle: 3 months for short trends, 12 months to remove seasonality.
What is the moving average formula?
It is a running average that uses only the most recent N values. You recalculate it each period, dropping the oldest value and adding the newest. Analysts use it on revenue, churn, headcount, spend and usage data.
The formula has three parts: the window size (N), the values inside the window, and the divisor (N). The window is your main decision.
A short window follows changes quickly but stays noisy. A long window is smooth but slow to react.
For SaaS teams, a 3-month moving average on monthly recurring revenue shows the recent direction. A 12-month window removes seasonal swings from renewal or usage data. Both are valid; they answer different questions.
How do you calculate a simple moving average?
Add the values in the window and divide by the number of values. Repeat for each period by shifting the window forward one step. The first average appears once you have N values.
Formula: SMA = (V₁ + V₂ + … + Vₙ) ÷ N
Steps: 1. Choose the window size N.
-
List the values in order by period.
-
Sum the first N values and divide by N.
This is the first SMA. 4.
Drop the oldest value, add the next period's value, and divide by N again. 5.
Repeat until you reach the latest period.
This is the standard definition used in statistics and finance, and any spreadsheet can compute it with the AVERAGE function over a sliding range.
What is a worked moving average example?
Here is a 3-month moving average on example MRR figures. The numbers are illustrative, not a benchmark.
| Month | MRR ($) | 3-Month SMA ($) |
|---|---|---|
| Jan | 40,000 | — |
| Feb | 42,000 | — |
| Mar | 43,000 | 41,667 |
| Apr | 46,000 | 43,667 |
| May | 45,000 | 44,667 |
| Jun | 49,000 | 46,667 |
March: (40,000 + 42,000 + 43,000) ÷ 3 = 41,667. April: (42,000 + 43,000 + 46,000) ÷ 3 = 43,667. The raw MRR dips in May, but the 3-month average keeps rising, which shows the underlying trend is up.
Build the same table in a spreadsheet or use the free moving average calculator to check your numbers before you share a trend line.
How do you calculate a weighted moving average?
Multiply each value by its weight, sum the results, and divide by the total of the weights. Weights are often 1, 2, 3 for a 3-period WMA, so the newest period counts most. The formula is WMA = (V₁ × W₁ + V₂ × W₂ + … + Vₙ × Wₙ) ÷ (W₁ + W₂ + … + Wₙ).
On the same data, May's 3-month WMA with weights 1, 2, 3 is (43,000 × 1 + 46,000 × 2 + 45,000 × 3) ÷ 6 = 45,333. That is higher than the SMA's 44,667 because the most recent month gets the heaviest weight.
Use a WMA when recent periods matter more, such as weekly usage or support ticket volume. Use the SMA when you want a stable, easy-to-explain trend for board or finance reporting.
What are the most common moving average mistakes?
The most common mistakes are mismatched windows, mixing period lengths, and treating the average as a forecast. Each one distorts the trend you are trying to show.
- Comparing averages with different windows. A 3-month and a 12-month average will not line up; pick one and label it.
- Mixing monthly and weekly data. Keep every value on the same period length.
- Ignoring the lag. A long window makes turns appear late; do not read it as real-time.
- Treating it as a forecast. A moving average describes the past; projections need growth assumptions.
- Forgetting the first N − 1 blanks. The average cannot start until the window is full.
- Hiding outliers without saying so. One spike still enters the window for N periods.
How do you use moving averages in SaaS reporting?
Use the moving average to describe trend direction, then act on the smoothed line, not the raw monthly noise. It answers "is the trend improving or fading?" and keeps one-off spikes from driving decisions.
For revenue, run a 3-month SMA on MRR and compare it with how to calculate ARR so monthly and annual views agree. For spend, smooth monthly SaaS costs before you set next quarter's budget. For retention, a 3-month average on churn separates a real shift from a single bad month.
A few practical rules of thumb, common in finance and ops teams:
- Use 3 periods for a fast read and 12 periods to remove seasonality.
- Apply the same window to every month in a chart so the comparison is fair.
- Report the window size next to the number, such as "3-mo SMA".
How do you turn the result into a decision?
Convert the smoothed trend into a single number people can act on, such as a growth rate or a budget change. A moving average is only useful when it changes a decision.
-
Chart the raw values and the moving average together using the CSV to chart maker.
-
Note the direction of the smoothed line over the last 3 to 6 periods.
-
Calculate the change between the latest and prior average with the percentage change calculator.
-
Set a threshold, such as two consecutive declining averages, that triggers a review.
-
Tie the trend to a metric on your KPI dashboard so it is reviewed on a fixed cadence.
A moving average is a smoothing tool, not a model. Pair it with growth assumptions, like those in a SaaS revenue forecast, when you need a forward number.
Frequently asked questions
What is the moving average formula in simple terms?
It is the sum of the last N values divided by N. You recalculate it each period by dropping the oldest value and adding the newest. A 3-month average adds three months and divides by three.
What is the difference between SMA and WMA?
A simple moving average weights every value equally. A weighted moving average gives recent values more weight by multiplying each by a factor before dividing by the total weights. The WMA reacts faster to recent changes.
How do I choose the window size N?
Match N to your decision cycle and data noise. Use 3 periods for a quick trend read and 12 periods to remove seasonality. Shorter windows react faster but stay noisier.
Can a moving average be used to forecast?
Not on its own. A moving average describes past values and always lags the current period. For projections, add growth or seasonality assumptions rather than extending the average.
Why are the first values blank in a moving average?
The average cannot be computed until the window is full. A 3-month average needs three values, so the first two periods have no result. This is normal and not a data error.