A moving average smooths out noise by averaging each point with the few before it — a 3-month rolling average of sales, a 7-day average of traffic. The core is just AVERAGE over a window that slides down with the formula.
The example
Monthly sales with a 3-month moving average in column C (starts at the 3rd month).
| A | B | C | |
|---|---|---|---|
| 1 | Month | Sales | 3-mo avg |
| 2 | Jan | 100 | |
| 3 | Feb | 140 | |
| 4 | Mar | 120 | 120 |
| 5 | Apr | 180 | 147 |
| 6 | May | 150 | 150 |
The formula
The moving average in C4, filled down:
How it works
The window is a relative range, so it slides:
- In C4 the window is
B2:B4— the current month and the two before it. - Copy down to C5 and the relative reference shifts to
B3:B5; C6 becomesB4:B6. - Each cell is therefore the average of its own 3-month window — the “moving” part.
- The first two months have no full window, so leave them blank (or they’d average fewer points).
Dynamic window size? Use OFFSET to make the period a variable: =AVERAGE(OFFSET(B4, 0, 0, -E1, 1)) averages the last E1 rows ending at B4.
Try it: interactive demo
Pick a window size; see the moving average of the last point.
Variations
Weighted moving average
Give recent points more pull with SUMPRODUCT:
Dynamic window with OFFSET
Let a cell control the period:
Centered moving average
Average around the point, not just behind it:
Pitfalls & errors
The first rows have no full window. Leave them blank rather than averaging 1–2 points, which would distort the trend.
Lock the window only if you must. A moving average needs a relative range so it slides — don’t anchor it with $.
Blanks pull the average. AVERAGE ignores truly empty cells, but a 0 entered for “no data” is counted — use blank, not 0, for missing periods.
Practice workbook
Frequently asked questions
How do I calculate a moving average in Excel?
How do I make the moving-average period adjustable?
Why are the first rows of my moving average blank?
Stop fighting formulas. Learn them in a day.
This recipe is one of hundreds of real-world formulas we teach. Our Excel Formulas & Functions class covers lookups, logic, text, and dynamic arrays hands-on — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.
See the Formulas & Functions Class