A moving average smooths a noisy series so the direction underneath it becomes visible. In a spreadsheet you can build one with a single AVERAGE formula copied down a column, and a line chart will show you whether the trend is rising, falling or flat. The harder part is choosing the window length, knowing what lag you are accepting, and avoiding the errors that quietly make the line wrong.
What a moving average tells you
A moving average replaces each value with the average of itself and the values around it. Take the last three weeks of sales, average them, record the result, then slide the window forward one week and repeat. Random week-to-week swings partly cancel out, and what remains is the underlying movement.
The window and the average
The window is the number of periods in each average. A 3-period window averages three values, a 7-period window averages seven, and so on. The window length is the single most important setting in the whole exercise, because it controls how much smoothing you get and how far the line trails behind the actual data.
Each point on the moving average line is a summary of the window, not a measurement of a single day or week. That is why it looks calmer than the raw series.
Why the average is a trend signal, not a forecast
A moving average describes what has already happened. It does not predict next month. When the line turns upward, it tells you the recent average is higher than the average of the period before, which is a statement about the past. Some teams use it as a rough guide to what comes next, and that is a reasonable use if they know its limits, but the line itself is not a forecast.
Skip the setup
Calories, macros and body measurements, with a moving-average trend line so daily ups and downs don’t throw you.
Choosing between the simple, centred and exponential versions
There are three versions you will meet in practice. They differ in where the window sits and how much weight recent values receive.
| Attribute | Trailing simple (SMA) | Centred simple | Exponential (EMA) |
|---|---|---|---|
| Window sits | Current period and the ones before it | Equal numbers of periods either side | Mostly recent periods, with a long tail of older ones |
| Lag behind the data | Yes, roughly half the window length | None in the usual sense | Less than a simple average of the same window |
| Uses future values | No | Yes, so it cannot be used live | No |
| Formula difficulty | One AVERAGE per row | One AVERAGE per row, offset to centre | One line per row, using a smoothing factor |
| Sensitivity to a single spike | Spike affects the window for N periods, then drops out sharply | Same, but spreads the effect both sides | Spike fades gradually and does not drop out |
| Best use | Monitoring live data, reporting | Historical analysis, identifying turning points after the fact | Tracking data where recent changes matter more |
For most operational reporting, the trailing simple version is the right default. It is easy to audit, every value depends only on data that already exists, and anyone reviewing the sheet can check a row by hand. The centred version is useful when you are studying history and want turning points to line up with the dates they occurred on. It must not feed decisions made in real time, because the last few points need values that have not arrived yet.
The exponential version reacts faster and is less jumpy at the start of a window. Its cost is that it is harder to explain to a stakeholder who asks what “the average of the last seven weeks” means, because the answer is “a weighted blend that leans towards the most recent weeks”. Choose it when responsiveness matters more than simplicity.
Setting up a moving average in a spreadsheet
The steps below assume dates in column A, values in column B, and a header in row 1. The same logic works in Excel and Google Sheets.
Step-by-step: a trailing simple moving average
- Sort the data by date, oldest first. A moving average depends on order, and an unsorted table produces an average of unrelated rows.
- Confirm there is exactly one row per period, with no duplicates and no skipped periods (see the edge cases section for what to do when there are gaps).
- In C4, enter
=AVERAGE(B2:B4)for a 3-period window. Row 4 is the first row where three values exist, so the formula starts there. - Copy the formula down to the last row of data. Each row averages its own value and the two above it.
- Leave rows 2 and 3 blank in column C. Averaging fewer values than the window size would give a figure that looks like a moving average but is not one.
- To change the window, rewrite the range. For a 7-period window in row 8, the formula becomes
=AVERAGE(B2:B8).
If you want to change the window without editing every formula, put the window length in a cell, such as F1, and use =IF(COUNT(OFFSET(B8,-($F$1-1),0,$F$1,1))<$F$1,"",AVERAGE(OFFSET(B8,-($F$1-1),0,$F$1,1))). OFFSET is volatile, meaning it recalculates on every change in the workbook, so on very large sheets, INDEX is the lighter choice: =AVERAGE(INDEX(B:B,ROW()-$F$1+1):B8), copied down.
Adding the chart
Select the date column, the raw values and the moving average column, then insert a line chart. In Excel, use Insert, then Line, and check that the date column is treated as a date axis, not as text. In Google Sheets, use Insert, then Chart, and set the chart type to Line.
Give the two series distinct styles. A thin grey line for raw values and a thicker coloured line for the average makes the trend readable at a glance. Label the window in the series name, for example “3-week moving average”, so the chart can be understood without the sheet beside it.
Exponential moving average in one column
An exponential average needs a smoothing factor, usually written as alpha. A common choice is alpha = 2 / (N + 1), where N is the equivalent window length. For N = 3, alpha is 0.5.
Put alpha in a labelled cell, for example F1. Start the column with the first raw value, then apply the recurrence:
- In C2, enter
=B2. - In C3, enter
=$F$1*B3+(1-$F$1)*C2. - Copy C3 down.
The first few values depend on the starting point, so treat the opening rows with caution. A longer history reduces the effect of the seed.
Using the Analysis ToolPak in Excel
Excel desktop includes a Moving Average tool under Data, then Data Analysis, in the Analysis ToolPak. It asks for an input range, an interval (the window length) and an output range. It is quick for a one-off report.
It has two drawbacks. The output is static values, not formulas, so it will not update when the source data changes. It also writes #N/A into the first rows, which can break charts and downstream sums if you do not handle them. For a sheet that gets refreshed, a formula is the better choice.
How to choose the window length
The window should match the rhythm of the data and the question you are asking. Use the following as starting points, then test two or three options against the data you actually hold.
- Daily data with a weekly pattern: a 7-period window removes the weekday effect, since every day of the week appears exactly once in the average.
- Daily data you want to watch closely: 14 or 28 periods, which still span whole weeks and smooth more.
- Weekly data: 4 periods gives roughly a month, 13 gives roughly a quarter, and 52 gives a full year that removes most seasonal movement.
- Monthly data: 3 periods for a quarter, 12 for a year. A 12-month window is the usual way to remove seasonality from monthly figures.
The trade-off is direct. A short window reacts quickly but keeps much of the noise. A long window is calm but arrives late. If your window is 12 weeks, a genuine change in direction will not be fully visible in the line for about six weeks. That lag is the price of smoothing, and it should be stated in any report that uses the line.
A practical test: pick the window whose line turns at about the same time as the turns you can see in the raw data, without following every small wobble. If you cannot tell the windows apart, pick the shorter one, because it will show you change sooner.
Ready-made template
Holdings, dividends and yield by month, with sparkline-style trends and a portfolio summary.
Worked example: ten weeks of sales
Consider a small shop recording weekly unit sales for ten weeks. The raw values are 120, 135, 128, 150, 142, 160, 155, 171, 165 and 180. Week 1 sits in row 2, so week 10 sits in row 11.
With a 3-week trailing window, the first average appears in week 3, in row 4. The formula =AVERAGE(B2:B4) returns (120 + 135 + 128) / 3 = 127.7. Copied down, the full column reads:
| Week | Units sold | 3-week moving average |
|---|---|---|
| 1 | 120 | blank |
| 2 | 135 | blank |
| 3 | 128 | 127.7 |
| 4 | 150 | 137.7 |
| 5 | 142 | 140.0 |
| 6 | 160 | 150.7 |
| 7 | 155 | 152.3 |
| 8 | 171 | 162.0 |
| 9 | 165 | 163.7 |
| 10 | 180 | 172.0 |
The raw figures jump between 142 and 160 and between 155 and 171, which makes the direction hard to judge by eye. The moving average rises in every week from week 4 onwards except none; it climbs steadily from 127.7 to 172.0. The trend is upward, and the average gained about 44 units over eight weeks.
Now compare the exponential version with an alpha of 0.5, starting from week 1. The results are 120.0, 127.5, 127.8, 138.9, 140.4, 150.2, 152.6, 161.8, 163.4 and 171.7. The shape matches the simple average closely, and the final value is almost the same. For this series, the choice between them makes little difference, which is common when the trend is steady. It matters more when the data has a sharp shift partway through.
The centred version would put week 2’s value at 127.7, the same number the trailing version shows at week 3. That one-week difference is the lag in concrete form. If the shop owner had acted on the trailing line in week 10, they would have been reacting to what happened around weeks 8 and 9.
Reading the chart: what counts as a trend
Read the moving average line for direction, slope and consistency. A rising line tells you the average is increasing. A steep slope tells you it is increasing quickly. A line that rises for several consecutive periods, with no sustained dip, is more convincing than one that rises after a single good week.
A flat line means the average is stable, even if the raw data still swings around it. A line that changes direction is a candidate turning point, and it should be checked against the raw series and against any known events before it is reported as a change in trend.
Do not treat the first and last few points as settled. The start of the line depends on the window and on the earliest data, and the end moves as new values arrive. When you report a trend, state the window, the date range and the number of periods used.
A checklist before you act on a moving average
Use this list each time a moving average goes into a report or a decision. It takes a few minutes and catches most of the errors described above.
- The data is sorted by date and has one row per period.
- The window length is stated in the chart title or the series name.
- Rows without a full window are blank, not partly calculated.
- Blank or missing periods have been handled, either by a date-based formula or by resampling.
- Known one-off events are flagged, and any adjustment is recorded.
- The raw series is shown alongside the average.
- The window is short enough to be useful for the decision and long enough to remove the noise that matters.
- The trend has persisted for several consecutive periods before it is called a turn.
- The lag is stated, so readers know the line describes the past.
- The formula references have been spot-checked by hand for at least two rows, including one near the end of the data.
Keep the sheet, the window setting and the checklist together in one workbook. When someone else inherits the file, they will see what was built, why, and what to check, without having to rebuild the logic from the formulas alone.

Get the finished file
Ultimate Small Business Dashboard
A ready-made Excel dashboard for monthly sales, spending and profit, with charts that fill in as you log entries.