FORMULAS & FUNCTIONS

Running Total in Excel (Cumulative Sum, by Group, in a Table)

A running total (cumulative sum) adds each new value to everything above it: a bank balance after each transaction, sales to date, or spending so far this month. In Excel you can build one with a simple previous-row formula or an expanding SUM range. This guide covers both, plus blank rows, running totals inside an Excel table, totals that restart for each category or month, and year-to-date against a target, with a free workbook.

Running total in Excel: a cash book for October 2026 with 20,692.30 in and 15,147.45 out, a closing balance of 14,044.85 and a lowest balance of 5,105.50.
A running balance for a month of cash transactions.

Two ways to write a running total

MethodFormula in row 7Best for
Previous row + this row=E6+C7-D7Balances with money in and out; easy to read
Expanding SUM range=SUM($C$6:C7)Lists you sort, filter or edit; no dependency on the row above
Free download: Get the running total examples workbook (.xlsx). It has a Cash Book, a Table example, By Category, YTD and How It Works. Works in Excel 2010 and later, Microsoft 365 and Excel for the web.

Step 1: Running balance from the previous row

The Cash Book lists October’s transactions with money in (column C) and money out (column D). The opening balance of 8,500.00 is in F3. The first balance in E6 starts from it, and every row below adds to the balance above:

=$F$3+C6-D6
=E6+C7-D7

Copy the second formula down. Excel treats blank cells as 0, so a row with only money out still works. After 20,692.30 in and 15,147.45 out, October ends at 14,044.85.

Excel running balance formula =E6+C7-D7 in a cash book, starting from an 8,500.00 opening balance and ending October at 14,044.85.
Each balance builds on the one above.
Delete or sort a row and it breaks. The previous-row formula points at the cell above. Delete a row and the next formula shows #REF!; sort the list and balances follow the wrong rows. For lists you edit often, use the expanding SUM in Step 2.

Step 2: Running total with an expanding SUM

An expanding range has a locked start and a relative end. In F6, copied down:

=$F$3+SUM($C$6:C6)-SUM($D$6:D6)

In row 9 the ranges become $C$6:C9 and $D$6:D9: everything from the first row to the current row. The $ signs keep the start fixed (press F4 to add them). For a plain cumulative sum without an opening balance, it is just =SUM($C$6:C6). The Check column compares both methods: Ties on every row.

Excel running total with an expanding range, =IF(AND(C9="",D9=""),"",$F$3+SUM($C$6:C9)-SUM($D$6:D9)), matching the previous-row balance on every row.
Locked start, moving end.
Large lists: An expanding range recalculates more cells than the previous-row method (row 1,000 adds 1,000 cells). For a few thousand rows that is no problem; for very large data, the previous-row method or a PivotTable running total is lighter.

Step 3: Keep empty rows blank and tie out the result

Prepare rows for future transactions and the previous-row method repeats the last balance all the way down (rows 18 and 19, in red). Wrap the formula in IF so empty rows stay blank:

=IF(AND(C6="",D6=""),"",$F$3+SUM($C$6:C6)-SUM($D$6:D6))

Then prove the running balance with an independent calculation: opening + total in – total out. To get the last non-blank running balance, LOOKUP finds the last number in a column:

=LOOKUP(2,1/(F6:F19<>""),F6:F19)

Both give 14,044.85: Ties. =MIN(F6:F19) adds a useful cash figure: the lowest balance of the month, 5,105.50 after payroll on Oct 12. It tells you how much buffer the account really had.

Excel running balance that stays blank on empty rows, with a check that the closing balance of 14,044.85 equals the last running balance.
A running balance you can trust, with blanks for future rows.

The closing balance is what you agree to the bank statement in a bank reconciliation, and the same running balance drives a petty cash log.

Step 4: Running total in an Excel table

In an Excel table (Ctrl + T), formulas use column names instead of cell addresses. In the Running total column of the Sales table:

=SUM(INDEX([Amount],1):[@Amount])

INDEX([Amount],1) is the first cell of the Amount column and [@Amount] is the current row, so the range runs from the top to the current row. Type the formula once and the table fills the whole column; add an invoice at the bottom and its running total appears automatically. The eight October invoices run up to 11,980.19, equal to =SUM(Sales[Amount]).

Excel table running total =SUM(INDEX([Amount],1):[@Amount]) for eight October invoices, ending at 11,980.19 and tied to the table total.
Structured references grow with the table.
Why not =SUM([Amount])? [Amount] alone is the whole column, so every row would show the table total. You need a range that stops at the current row, which is what INDEX(…,1):[@Amount] builds.

Step 5: Running total by category or by month

To restart the running total for each group, use SUMIFS with expanding ranges for both the values and the criteria:

=SUMIFS($C$4:C4,$B$4:B4,B4)

Each row adds the amounts above it that have the same category. Supplies runs to 817.05 by Oct 14 and ends at 882.50. Swap the criteria column for a month column (first day of each month, =DATE(YEAR(A4),MONTH(A4),1)) and the total restarts each month: Oct 2 starts again at 171.25. For month totals rather than running totals, see how to sum monthly values with SUMIFS.

Excel running total by category with =SUMIFS($C$4:C11,$B$4:B11,B11), plus a running total by month, tied to the category totals.
One running total per category, and one per month.

The summary below the list checks that the last running total for each category equals the category total from a normal SUMIFS. Because the amounts are positive, the last running total is also the largest, so =SUMPRODUCT(MAX(($B$4:$B$13=A16)*$E$4:$E$13)) finds it in any Excel version. Sort the data by date first: the formulas add rows in the order they appear.

Step 6: Year-to-date sales against a target

A YTD column is a running total of months. Leave future months blank:

=IF(B4="","",SUM($B$4:B4))

The YTD target is the annual target spread evenly, =$B$2/12*ROWS($B$4:B4), and YTD vs target is YTD sales divided by the YTD target. Through October, sales of 122,630.00 against a YTD target of 125,000.00 is 98.1%, with 27,370.00 still to sell to reach the 150,000.00 annual target. A running average, =AVERAGE($B$4:B4), uses the same expanding range.

Excel year-to-date sales running total of 122,630.00 through October against a YTD target of 125,000.00, or 98.1%.
Year to date, target to date, and what is left.

Use the YTD numbers in a 12-month cash flow forecast, or chart the YTD and target columns as two lines to show whether the year is on track.

Ready-to-share test: Type 15000 in YTD!B14 for November. YTD sales become 137,630.00, YTD vs target 100.1% and still to sell 12,370.00; YTD = total still shows Ties. Clear B14 when you are done.

Running total in a PivotTable (no formulas)

  1. Build the PivotTable with Date (grouped by month) in Rows and Amount in Values.
  2. Right-click a value and choose Show Values As > Running Total In.
  3. Pick the base field (Date, or Months if you grouped the dates) and click OK.
  4. Add Amount to Values a second time if you want the monthly amount and the running total side by side.

Choose % Running Total In instead to show how much of the year’s total has been reached by each month. A PivotTable running total updates when you refresh, so it suits large lists; the formula versions above suit balances you keep row by row.

Frequently asked questions

What is the formula for a running total in Excel?

=SUM($B$2:B2) copied down, or =C1+B2 (previous total plus the current value). For a balance with money in and out, use =E6+C7-D7.

How do I make a running total in an Excel table?

=SUM(INDEX([Amount],1):[@Amount]). It sums from the first row of the column to the current row and fills new rows automatically.

How do I do a running total by group?

=SUMIFS($C$2:C2,$B$2:B2,B2) adds only the rows above with the same group in column B.

Why does my running total repeat at the bottom?

Empty rows add 0 to the previous total. Wrap the formula in IF, for example =IF(B2=””,””,SUM($B$2:B2)).

How do I check a running balance?

The last running balance must equal opening balance + total in – total out. Use LOOKUP(2,1/(range<>“”),range) to get the last value.

Final checklist

  • The data is sorted by date before the running total.
  • The start of each expanding range is locked with $ and the end is relative.
  • Empty rows return blank instead of repeating the total.
  • The last running balance equals opening + in – out.
  • Group running totals tie to the group totals.
  • Totals in tables use structured references; quick totals can use AutoSum (Alt + =).
Practice file: Download the running total examples and paste your own transactions into the Cash Book.

Know your numbers to date

Browse the ready-to-use Excel templates for cash and sales tracking, visit the OneXcel Tutorial Hub for step-by-step guides, or chart your year to date in the OneXcel Dashboard Builder.