FormulaCraft

How to sum the last N rows in Excel and Google Sheets

Topic:SUM & aggregation
Excel & Google Sheets
=SUM(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) finds the last filled row by counting non-empty cells.
  2. 2OFFSET starts that many rows down minus N, then takes a block N rows tall and 1 column wide.
  3. 3SUM totals that final block — here the last 3 values, 40 + 50 + 60 = 150.

Tips

Working on a sheet you inherited? Run the Auditor on the whole file first — it flags every #REF!, #N/A, broken column pattern, and inconsistent formula in seconds, free, no signup.

Frequently asked

How do I sum the last N rows ignoring blanks in between?

COUNTA counts only non-empty cells, so gaps are skipped when locating the end, but the N-row block itself is positional. For scattered data, filter first.

More on SUM & aggregation

See all →

Formulas used

Related tasks

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

Last reviewed: