Score the most recent N entries no matter how the list grows — last 3 sales, last 5 readings. OFFSET anchors a window at the bottom of the data, and AVERAGE reads it.
The example
The window slides to the newest values.
| A | B | |
|---|---|---|
| 1 | Reading | Avg last 3 |
| 2 | 8 | — |
| 3 | 6 | |
| 4 | 10 | 8 |
The formula
The formula:
How it works
How it works:
COUNT(B:B)counts the filled numeric cells — the position of the last value.OFFSET(B1, COUNT-N+1, 0, N, 1)builds a height-N window ending at that last value.AVERAGEthen means just those final N cells.- Add a new row and the window slides automatically — no formula edit needed.
OFFSET is volatile (recalculates often). For a non-volatile version on Excel 365, use =AVERAGE(TAKE(B2:B100, -N)) — TAKE with a negative count grabs the last N rows directly.
Try it: interactive demo
Values and N.
Variations
365 version
Non-volatile TAKE:
Sum the last N
Total instead:
Last single value
Most recent:
Pitfalls & errors
COUNT vs COUNTA. COUNT only sees numbers; use COUNTA if the column holds text or mixed data.
Gaps break it. OFFSET assumes a contiguous block — blanks inside the data shift the window.
OFFSET is volatile. It recalculates on every change; prefer TAKE on 365.
Practice workbook
Frequently asked questions
How do I average the last N values in Excel?
Is there a simpler way in Excel 365?
Why does my window include wrong cells?
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