A running total that starts over for each customer, project, or month. SUMIFS over the rows up to the current one, filtered to the same group, gives a per-group cumulative sum.
The example
The total restarts at each new group.
| A | B | C | |
|---|---|---|---|
| 1 | Group | Value | Running |
| 2 | X | 10 | 10 |
| 3 | X | 5 | 15 |
| 4 | Y | 8 | 8 |
The formula
Cumulative sum within the group:
How it works
Expanding ranges plus a group filter:
$B$2:B2and$A$2:A2are expanding ranges (absolute start, relative end) covering the rows up to the current one.SUMIFS(values, groups, A2)adds only the rows whose group matches the current row.- When the group changes, only the new group’s rows so far are summed — so the total resets.
- Sort by group (and date) for a meaningful per-group running total.
Running count per group uses the same pattern with COUNTIFS: =COUNTIFS($A$2:A2, A2) numbers the rows 1, 2, 3… within each group — handy for “nth order for this customer.”
Try it: interactive demo
Lines “group,value”.
Variations
Running count per group
Nth in group:
Running average
Per group:
Group total (all rows)
Final per group:
Pitfalls & errors
Anchor only the start. $B$2:B2 must have an absolute start and relative end, or it won’t expand row by row.
Sort by group. A scrambled order still sums correctly per group, but the “running” sequence only reads naturally when grouped.
Inserting rows. Expanding-range running totals can shift if you insert rows mid-range — rebuild if the layout changes.
Practice workbook
Frequently asked questions
How do I make a running total that resets for each group in Excel?
How do I number rows within each group?
Why doesn't my running total expand?
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