Calculation Issues

Calculate a Rolling 12-Month Average in Excel

Olivia MillerOlivia Miller Nov 18, 2026 870 views

Question details

Calculate a rolling 12-month average that uses fewer months at the beginning of a series.

Calculate a Rolling 12-Month Average in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
Monthly values begin in C2, and the user wants an average for each row that expands initially and then covers the latest 12 months.
Observed behavior
The desired average uses all available months through the first 12 rows and only the latest 12 monthly rows thereafter.
Before you start

Arrange the monthly values in chronological order in column C, starting at C2, with one month per row. Choose an empty column for the averages.

Solution 1Recommended

Use INDEX and AVERAGE for a Rolling 12-Month Window

Use this formula to calculate an expanding average for the first 12 months and a rolling average after that.

The formula selects rows rather than the last 12 nonblank values. AVERAGE ignores blank and text cells but includes zeros; if the selected range has no numeric values, it returns a #DIV/0! error.

1
Select the first result cell

Click D2, next to the first monthly value in C2.

2
Enter the formula

Type =AVERAGE(INDEX($C:$C,MAX(2,ROW()-11)):C2) in D2 and press Enter.

3
Fill down

Drag the fill handle from D2 down alongside the remaining monthly values. The range starts at C2, expands through 12 rows, and then advances one row at a time.

Use INDEX and AVERAGE for a Rolling 12-Month Window
Keep one month per row: A missing month represented by a blank row still occupies a position in the 12-row window, even though AVERAGE ignores the blank cell.
Calculate in WPS Spreadsheets

Calculate a Rolling 12-Month Average in WPS Spreadsheets

Use the same INDEX and AVERAGE formula in WPS Spreadsheets to calculate an expanding initial average followed by a rolling 12-month average.

  1. 1. Open your spreadsheet: Open WPS Spreadsheets and use Menu > Open to select your workbook.
  2. 2. Arrange monthly values: Place the values in column C starting at C2, with one month per row in chronological order.
  3. 3. Enter the average formula: Click D2, enter =AVERAGE(INDEX($C:$C,MAX(2,ROW()-11)):C2), and press Enter.
  4. 4. Copy the formula down: Drag the fill handle from D2 down to the last row of monthly data.
Calculate a rolling average without waiting for 12 months of data.Open and save Microsoft Excel XLSX files.Use a familiar spreadsheet interface and fill handle.
QA img-9

Frequently Asked Questions

What happens before there are 12 months of data?

The formula starts its range at C2. In D2 it averages C2, and in D3 it averages C2:C3, continuing to expand until the range reaches 12 rows.

How does the formula handle blank months?

AVERAGE ignores blank cells, but each blank row still counts as one of the 12 rows in the window. Enter one month per row to keep the window aligned with the calendar.

Are zero values included in the average?

Yes. AVERAGE includes numeric zeros in the selected range. Leave a cell blank only if its value should not be included in the average.

Why does the formula show #DIV/0!?

The selected range contains no numeric values. Check the cells in column C for numbers; blank cells and text do not provide a numeric value for AVERAGE.