56 free macros indexedAll toolsHow to runBlogGitHub ↗

How to Create a Running Total Column in Excel

How to add a running total in Excel: SUM with absolute references, the Running Total in pivot tables, and a free macro that writes static values.

2026-04-28

The cumulative-sum problem

You have a column of monthly amounts. You want a column showing year-to-date as of each row. Or a column of daily transactions where you want the running balance. The classic Excel approach is =SUM($B$2:B2) with anchored start and rolling end. It works but it's a formula that recalculates and depends on cell references staying valid.

TL;DR — Key takeaways

  • =SUM($B$2:B2) with anchored start is the formula approach. Works but recalculates and shifts on row delete.
  • Pivot tables have a "Running Total" option as a value field setting. Good when the data is already in a pivot.
  • A VBA macro writes static integers down the column to the right. Doesn't recalculate, doesn't break on row delete.

Method 1: =SUM with anchored start

=SUM($B$2:B2)

In C2, drop this formula. Fill down. The $B$2 is anchored; the B2 rolls. So C2 = SUM(B2:B2), C3 = SUM(B2:B3), C4 = SUM(B2:B4), and so on.

Pros: Live. Changes when source data changes.

Cons: Recalculates on every workbook recalc. For 100,000-row data, this is slow. And if a row is deleted from column B, every subsequent running total drops by the deleted amount.

Method 2: Pivot table Running Total

If your data is in a pivot:

  1. Drag the value field to Values area.
  2. Right-click the value column > Show Values As > Running Total In > pick the field to run total over.

Pivot does the running total automatically.

Pros: No formulas to maintain.

Cons: Only works when data is in a pivot.

Method 3: The free VBA macro

Download Add Running Total Column. Free .xlsm with one macro.

  1. Select the single column of numbers (include header row).
  2. Alt + F8, pick the macro, click Run.
  3. The macro writes a Running Total header in row 1 of the column to the right, then fills static running totals for each numeric row.

In place. Static values. No formula recalc dance.

Static vs formula running totals: which to use

NeedUse formulaUse macro
Live recalc on source changeYesNo (one-shot)
Survives row delete in sourceNo (totals shift)Yes (frozen at run time)
Works on 100k+ rows fastSlowFast
Easy to share without Excel recalc dependenciesNoYes

A common scenario: weekly cash position

Treasury analyst tracks weekly cash inflows and outflows. Each row is one week. The CFO wants running cumulative cash at any point in time.

With macro: select the weekly net column, run the macro, running total appears in the column to the right. Static values. CFO can copy the cell value into an email and it's correct as of the moment of generation.

With formula: if a row gets accidentally deleted upstream, the running total silently shifts. CFO emails a wrong number. The macro version doesn't have this risk.

Frequently asked questions

What about non-numeric cells in the column?

Non-numeric cells don't increment the running total and don't get a value written. So if row 5 is text like Subtotal, row 5 has no entry in the running total column, and row 6 picks up where row 4 left off.

Does it overwrite existing data in the destination?

Yes. The macro writes to the column directly to the right of your selection. Insert a blank column first if needed.

Can I get the running total to recalculate?

For recalculating, use the formula approach: =SUM($B$2:B2). This macro is for the static case. The two have different use cases.

What about category-grouped running totals (running total per category)?

The macro doesn't support grouping. For category running totals, use a pivot table or write a SUMIF formula chain.

Can I undo it?

Yes, Ctrl/Cmd + Z right after running.

What to do next

After adding the running total, common follow-up is a totals row at the bottom: Add Totals Row to Numeric Columns. The two pair: running total down the column, total at the bottom.