# How to calculate a running balance in Excel

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

**Excel:** `=SUM($C$2:C2)-SUM($D$2:D2)` (Every current version)

**Google Sheets:** the same formula works.

## Example

Sample data (row 1 is the header):

| A | B | C | D | E |
| --- | --- | --- | --- | --- |
| Date | Description | Deposit | Withdrawal | Balance |
| 2026-05-01 | Opening balance | 2500 |  |  |
| 2026-05-02 | Rent |  | 1450 |  |
| 2026-05-05 | Paycheck | 2180 |  |  |
| 2026-05-07 | Groceries |  | 163.42 |  |
| 2026-05-12 | Car payment |  | 389 |  |
| 2026-05-15 | Freelance invoice | 650 |  |  |
| 2026-05-19 | Electric bill |  | 94.18 |  |

Formula in E2, filled to E8: `=SUM($C$2:C2)-SUM($D$2:D2)`

Result: $2,500.00; $1,050.00; $3,230.00; $3,066.58; $2,677.58; $3,327.58; $3,233.40

## 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.

## Other ways

- `=SUM(C$2:C2)-SUM(D$2:D2)`: 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.

## 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))`.

Every formula and result on this page was checked by running it in the Spreadsheet Practice formula engine on 2026-10-30.

Source: https://spreadsheetpractice.com/formulas/running-balance
