# How to keep a running total blank on empty rows in Excel

Test the row first: `=IF(B2="","",SUM($B$2:B2))` shows the running total only where there is a value.

**Excel:** `=IF(B2="","",SUM($B$2:B2))` (Every current version)

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

## Example

Sample data (row 1 is the header):

| A | B | C |
| --- | --- | --- |
| Month | Donations | Running total |
| Jan | 4250 |  |
| Feb | 3980 |  |
| Mar | 5120 |  |
| Apr | 4675 |  |
| May |  |  |
| Jun |  |  |
| Jul |  |  |

Formula in C2, filled to C8: `=IF(B2="","",SUM($B$2:B2))`

Result: $4,250; $8,230; $13,350; $18,025; ; ; 

## How it works

A plain running total repeats the last value on every future row, which looks like real data. The IF checks whether the month has a figure: if not, it returns `""`, an empty-looking cell; if so, it shows the running total. Typing May's donations fills in May's total.

## Other ways

- `=IF(ISBLANK(B2),"",SUM($B$2:B2))`: ISBLANK reads more clearly, but it treats a formula that returns "" as not blank.

## Common mistakes

- Cells with `""` are text, so a chart plots them as 0 in some versions. Use `NA()` instead of `""` if a chart line should stop.
- Testing the running total instead of the input (`IF(SUM($B$2:B2)=0,…)`) hides real zero months too.

## Questions

**How do I do it in one spilling formula?**

In Excel 365: `=SCAN(0,B2:B8,LAMBDA(a,x,a+x))` gives the totals; wrap it in IF(B2:B8="","",…) to hide empty months.

**How do I stop a total showing 0 in an empty row?**

Use the same pattern on any formula: `=IF(B2="","",your_formula)`.

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-total-blank-for-empty-rows
