This guide will explain how you can use the SUM function to get running totals in Google Sheets.
The running total refers to the summation of a list of numbers that is updated when a new number is added in sequence.
The running total is essentially a partial sum. This summation is useful for determining the total at any given moment in a sequence.
Let’s take a look at a simple example where we can compute the running total.
Suppose you are keeping track of the number of guests entering a supermarket. You have hourly data on the count of customers entering each entrance. Given this dataset, you want to determine the number of guests that have entered by 12 pm, 3 pm, and 7 pm.
Since we have hourly data, we can simply order the dataset chronologically and create a new column that keeps track of the dataset’s running total.
To compute the running total in Google Sheets, we can use the
SUM function that adds up a range from the first cell in the sequence to the current cell in the sequence.
The use case above is one way to use running totals in Google Sheets. Running totals are also common with scoring systems and keeping track of financial earnings and expenses. Running totals can also handle both positive and negative values.
For example, we can add a running total to a table of e-wallet transactions. Negative values represent expenses or money sent, while positive values represent money received. The running total will let us know how much balance is left in the wallet after every transaction.
Now that we know when to use running totals, let’s look at how to use it on an actual sample spreadsheet.
A Real Example of Getting Running Totals in Google Sheets
Let’s take a look at a real example of the
SUM function being used in a Google Sheets spreadsheet to determine the running total.
Suppose you have a tracker where you write down a list of expenses made for a project with a budget of $5000. You would like to keep a running total to track the total amount of expenses at the end of every day.
The example below shows a table of expenses from July 28, 2022, to August 15, 2022. The running total is computed in column C. Using this column, we can determine how much of the budget has been spent so far on a particular date.
With this table, we can backtrack and determine what day we exceeded our original budget of $5000. In this case, we can see that the budget was exceeded on August 13.
To get the values in Column C, we need to use the following formula:
For our range, we write the starting cell as an absolute reference. This will enable us to drag the formula down and keep B2 as the start of our range.
You can make your own copy of the spreadsheet above using the link attached below.
If you’re ready to try adding your own running total in Google Sheets, follow our guide to start writing it yourself!
How to Get Running Totals in Google Sheets
This section will guide you through each step needed to compute the running total in a dataset. You’ll learn how we can use the
SUM function to get the partial sum of a sequence of numerical values.
Follow these steps to add a running total to your table:
- First, let’s add a new column to our dataset for our running total.
- Next, we’ll use the
SUMfunction to add all cells in our sequence so far. Since the value in cell B2 is both the starting cell and current cell, we’ll use the range $B$2:B2.
- Using the Fill Handle tool, you may now drag the formula down to the next cell. Notice how the first cell in our range remains the same, and our last cell increments by one.
- Use the same method to fill out the rest of the column. The final running total also functions as the actual total of column B.
- If you would like to keep the running total blank when the current row has no value, we can use a modified formula. In the formula below, we wrapped our
SUMfunction with an
IFfunction. If the current value is not blank, the formula returns the running total. If the current value is blank, then the function will return a blank string.
This step-by-step guide should be all you need to start adding running totals to your spreadsheet. We’ve shown you how to use the
SUM function to get a partial sum of a given sequence of numbers.
Running totals are just one example of a calculation you can set up in Google Sheets easily. With so many other Google Sheets functions available, you can surely find one that can help provide additional insights into your data.
Are you interested in learning more about what Google Sheets can do? Subscribe to our newsletter to find out about the latest Google Sheets guides and tutorials from us.