Spreadsheet Practice

How to calculate a running balance in Excel

Formula (Excel and Google Sheets)

=SUM($C$2:C2)-SUM($D$2:D2)

Subtract running withdrawals from running deposits: =SUM($C$2:C2)-SUM($D$2:D2), filled down.

Result on the example
one result per row in E2, filled down to E8
Works in
Every current version
Google Sheets
Same formula

See it work

The formula is already in E2, filled down to E8. Change any input and the result updates, or edit the formula to experiment.

How it works

Each row adds every deposit from the top down to itself and subtracts every withdrawal the same way. Empty cells count as 0, so it doesn't matter which column a transaction is in. Because each row recalculates from the top, inserting or deleting a row doesn't break the chain.

=SUM($C$2:C2)-SUM($D$2:D2)

Result2500

  1. $C$2:C2$2,500.00

    A range: one cell.

  2. SUM($C$2:C2)2500

    SUM: Adds numbers and ranges. Skips text and blanks.

    • number1$C$2:C2$2,500.00
  3. $D$2:D2(empty)

    A range: one cell.

  4. SUM($D$2:D2)0

    SUM: Adds numbers and ranges. Skips text and blanks.

    • number1$D$2:D2(empty)
  5. SUM($C$2:C2)-SUM($D$2:D2)2500

    The - operator subtracts.

In Google Sheets

The same formula works in Google Sheets: =SUM($C$2:C2)-SUM($D$2:D2). We ran it in Google Sheets mode on the same data and it returns the same results.

Other ways to do it

Each one was run on the same example sheet.

FormulaResultWhen to use it
=SUM(C$2:C2)-SUM(D$2:D2)$2,500.00, $1,050.00, $3,230.00…Locking only the row is enough when you fill down one column.

Common mistakes

  • The popular =E1+C2-D2 fails in the first row because E1 is the header text, giving #VALUE!. Start the first row with =C2-D2 and fill the E1+… version from row 3.
  • With the previous-row pattern, deleting a row leaves a #REF! in the row below. The SUM version doesn't depend on the row above.

Try it yourself

Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.

Calculate a running balance

In E2, calculate the balance after each transaction (all deposits so far minus all withdrawals so far), then fill down to E8.

Questions

How do I do it with one Amount column, positive and negative?

Use a running total: =SUM($C$2:C2), with withdrawals entered as negative numbers.

How do I hide the balance on empty rows?

Wrap it: =IF(AND(C2="",D2=""),"",SUM($C$2:C2)-SUM($D$2:D2)).

Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.