How to Calculate a Running Total in Google Sheets
Type =SUM($B$2:B2) in C2 and drag down — the locked start and moving end make each row add up everything above it.
=SUM($B$2:B2)
The absolute $B$2 anchors the start; the relative B2 grows as you fill down, so each row sums from the top to the current row.
How it works
A running (cumulative) total sums every value from the first row down to the current one. The trick is a half-locked range: anchor the start with a dollar-sign reference ($B$2) and leave the end relative (B2). As you drag the formula down, the range stretches — row 5 becomes $B$2:B5. For a spill-free single-cell version, use SCAN or a MMULT array. To restart the total for each category, add a SUMIF condition.
Variations
Whole column in one cell
=ARRAYFORMULA(IF(B2:B="","",SUMIF(ROW(B2:B),"<="&ROW(B2:B),B2:B)))
Fills the running total for the entire column without dragging.
Running total by group
=SUMIF($A$2:A2,A2,$B$2:B2)
Restarts the cumulative sum whenever the label in A changes.
Modern SCAN version
=SCAN(0,B2:B10,LAMBDA(acc,x,acc+x))
SCAN carries the accumulator down the range.
Examples
| Scenario | Formula |
|---|---|
| Cumulative sales down a column | =SUM($B$2:B2) |
| Running total that resets per region | =SUMIF($A$2:A2,A2,$B$2:B2) |
FAQ
Why does my running total stay the same on every row?
You locked both ends of the range. Anchor only the start: =SUM($B$2:B2), leaving the second reference relative so it grows.
How do I make a running total without dragging?
Use SCAN: =SCAN(0,B2:B10,LAMBDA(acc,x,acc+x)) fills the whole column from one cell.
How do I restart the total for each category?
Use =SUMIF($A$2:A2,A2,$B$2:B2), which only adds rows sharing the current label.
Related formulas
- IF vs IFS in Google Sheets — When to Use Each
- INDEX MATCH vs VLOOKUP in Google Sheets — Which Is Better
- SUMIF vs SUMIFS in Google Sheets — When to Use Each
- TEXTJOIN vs CONCATENATE in Google Sheets — Which to Use
- UNIQUE vs Remove Duplicates in Google Sheets — Which to Use
- VLOOKUP vs XLOOKUP in Google Sheets — Which One to Use
- DATEDIF in Google Sheets
- FILTER Function in Google Sheets