Spreadsheet Practice

How to calculate a moving average in Excel

Formula (Excel and Google Sheets)

=AVERAGE(B2:B4)

Average the last few rows with a relative range and fill down: =AVERAGE(B2:B4) in the third row gives a 3-month moving average.

Result on the example
one result per row in C4, filled down to C9
Works in
Every current version
Google Sheets
Same formula

See it work

The formula is already in C4, filled down to C9. Change any input and the result updates, or edit the formula to experiment.

How it works

Neither end of B2:B4 is locked, so the window slides down one row at a time: April averages February to April, May averages March to May. The first two months have no full window, which is why the formula starts in March. The moving average smooths out single-month spikes.

=AVERAGE(B2:B4)

Result42516.66667

  1. B2:B43 rows × 1 col: $42,100, $45,800, $39,650

    A range: 3 cells in one column.

  2. AVERAGE(B2:B4)42516.66667

    AVERAGE: Arithmetic mean of the numbers.

    • number1B2:B43 rows × 1 col: $42,100, $45,800, $39,650

In Google Sheets

The same formula works in Google Sheets: =AVERAGE(B2:B4). We ran it in Google Sheets mode on the same data and it returns the same results.

Other ways to do it

Each one was run on the same example sheet.

FormulaResultWhen to use it
=SUM(B2:B4)/3$42,517, $44,550, $46,383…The same average spelled out; change the 3 together with the range for other window sizes.

Common mistakes

  • Locking the start ($B$2:B4) turns it into a growing average of everything so far, not a moving one.
  • Blank months shrink the window, because AVERAGE skips blanks. Fill gaps with 0 only if the month really had no sales.

Try it yourself

Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.

Calculate a moving average

In C4, average March and the two months before it, then fill down to C9 so each row averages its own last three months.

Questions

How do I make a 7-day moving average?

Start in the seventh row with =AVERAGE(B2:B8) and fill down.

How do I weight recent months more?

Use SUMPRODUCT with weights that add to 1: =SUMPRODUCT(B2:B4,{0.2;0.3;0.5}).

Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.