Situatie
Solutie
Creating Running Totals in Regular Ranges
To create a running total in an Excel range that isn’t formatted as an Excel table, you need to use a combination of absolute and relative references.
In this example, you want the Running Total column to update each time you add another value to the Profit column.
To do this, in cell C2, type:
=SUM($B$2:B2)
and press Ctrl+Enter to commit the formula and stay in the same cell.
Rather than typing the dollar symbols manually, place your cursor within the cell reference in the formula, and press F4.
Adding dollar symbols to the first reference (known as an absolute reference) fixes it. In other words, whenever the formula calculates the running total on each row, it will always take this cell as the start of the values to sum. On the other hand, the second reference doesn’t contain dollar symbols (known as a relative reference), because each time you duplicate the formula to the next row, you want it to pick up the corresponding figure.
To see this in action, first, click and drag the fill handle in cell C2 down to cell C3.
Then, select cell C3, and note that the formula in the formula bar is:
=SUM($B$2:B3)
The absolute $B$2 reference has remained fixed, while the relative B3 reference picks up the next value in the Profit column to update the running total.
You can now click and drag the fill handle to the bottom of the range so the formula is ready to pick up any new values you add to the subsequent rows.
However, there’s one issue with this as it stands—the running total is repeated even in the rows where there aren’t yet any profit figures. While these totals are technically correct, they look untidy and could cause confusion.
Leave A Comment?