FormulaCraft

How to average the last N values in Excel and Google Sheets

Topic:AVERAGE & central tendency
Excel & Google Sheets
=AVERAGE(OFFSET(A1,COUNTA(A1:A7)-3,0,3,1))

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1COUNTA(A1:A7) locates the last filled cell in the column.
  2. 2OFFSET steps to N rows before the end and returns a block N tall.
  3. 3AVERAGE divides the sum of that block by N — here (40 + 50 + 60) / 3 = 50.

Tips

Need it for your exact data?

Describe your columns in plain English and get the precise formula for your sheet, with the right Excel or Sheets syntax.

Frequently asked

Is this the same as a moving average?

It is a single trailing average of the last N values. For a moving average that recomputes down a whole column, use AVERAGE over a sliding range in each row.

More on AVERAGE & central tendency

See all →

Formulas used

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: