This short tutorial shows how a usual Excel Sum formula with a clever use of absolute and relative cell references can quickly calculate a running total in your worksheet.
A running total, or cumulative sum, is a sequence of partial sums of a given data set. It is used to show the summation of data as it grows with time (updated every time a new number is added to the sequence).
This technique is very common in everyday use, for example to calculate the current score in games, show year-to-date or month-to-date sales, or compute your bank balance after each withdrawal and deposit. The following examples show the fastest way to calculate running total in Excel and plot a cumulative graph.
How to calculate running total (cumulative sum) in Excel
To calculate a running total in Excel, you can use the SUM function combined with a clever use of absolute and relative cells references.
For example, to calculate the cumulative sum for numbers in column B beginning in cell B2, enter the following formula in C2 and then copy it down to other cells:
=SUM($B$2:B2)
In your running total formula, the first reference should always be an absolute reference with the $ sign ($B$2). Because an absolute reference never changes no matter where the formula moves, it will always refer back to B2. The second reference without the $ sign (B2) is relative and it adjusts based on the relative position of the cell where the formula is copied. For more information about Excel cell references, please see Why use dollar sign ($) in Excel formulas.
So, when our Sum formula is copied to B3, it becomes SUM($B$2:B3)
, and returns the total of values in cells B2 to B3. In cell B4, the formula turns into SUM($B$2:B4)
, and totals numbers in cells B2 to B4, and so on:
In a similar manner, you can use the Excel SUM function to find the cumulative sum for your bank balance. For this, enter deposits as positive numbers, and withdrawals as negative numbers in some column (column C in this example). And then, to show the running total, enter the following formula in column D:
=SUM($C$2:C2)
Strictly speaking, the above screenshot shows not exactly a cumulative sum, which implies summation, but some sort of "running total and running difference" Anyway, who cares about the right word if you've got the desired result, right? :)
At first sight, our Excel Cumulative Sum formula looks perfect, but it does have one significant drawback. When you copy the formula down a column, you will notice that the cumulative totals in the rows below the last cell with a value in column C all show the same number:
To fix this, we can improve our running total formula a bit further by embedding it in the IF function:
=IF(C2="","",SUM($C$2:C2))
The formula instructs Excel to do the following: if cell C2 is blank, then return an empty string (blank cell), otherwise apply the cumulative total formula.
Now, you can copy the formula to as many cells as you want, and the formula cells will look empty until you enter a number in the corresponding row in column C. As soon as you do this, the calculated cumulative sum will appear next to each amount:
How to make a cumulative graph in Excel
As soon as you've calculated the running total using the Sum formula, making a cumulative chart in Excel is a matter of minutes.
- Select your data, including the Cumulative Sum column, and create a 2-D clustered column chart by clicking the corresponding button on the Insert tab, in the Charts group:
- In the newly created chart, click the Cumulative Sum data series (orange bars in this example), and right click to select Change Series Chart Type... from the context menu.
- If you are using a recent version of Excel 2013 or Excel 2016, select the Combo chart type, and click on the first icon (Clustered Column - Line) at the top of Change Chart Type dialog:
Or, you can highlight the Custom Combination icon, and choose the line type you want for the Cumulative Sum data series (Line with Markers in this example):
In Excel 2010 and earlier, simply select the desired line type for the Cumulative Sum series, which you've selected on the previous step:
- Click OK, and evaluate your Excel cumulative chart:
- Optionally, you can right-click the Cumulative Sum line in the chart, and select Add Data Labels from the context menu:
As the result, your Excel cumulative graph will look similar to this:
To embellish your Excel cumulative chart further, you can customize the chart and axes titles, modify the chart legend, choose other chart style and colors, etc. For the detailed instructions, please see our Excel charts tutorial.
This is how you do a running total in Excel. If you are curious to learn a few more useful formulas, check out the below examples. I thank you for reading and hope to see you again soon!
103 comments
Hi there...I know this is an old post but putting this out there.
Is there a way to have a running total in one column, let's say column D, with "debits" in column B and "credits" in column C?
Is there a formula I can plug into Excel to add from Column C and subtract items from Column B for a running total in Column D?
Thanks
Hello Carolyn!
If I understand your task correctly, the following formula should work for you:
=SUM($C$2:C2) - SUM($B$2:B2)
Hey,Anyone know to find overall total from different sheets?
Hi! If I got you right, this guide will help you with your task: 3-D reference in Excel: reference the same cell or range in multiple worksheets.
The formula =SUM($L$7:L7) is working for me in an area formatted as a table; however, whenever I add a new row, the new row will have the correct formula, but what had previously been the final cell in that column will change to include the new row. Each subsequent adding of a row will screw up what had previously been the final row.
The formulas in three cells in a column will go from:
=SUM($L$7:L7)
=SUM($L$7:L8)
=SUM($L$7:L9)
To (when adding a forth row)
=SUM($L$7:L7)
=SUM($L$7:L8)
=SUM($L$7:L10)
=SUM($L$7:L10)
Adding a fifth row will turn to
=SUM($L$7:L7)
=SUM($L$7:L8)
=SUM($L$7:L11)
=SUM($L$7:L11)
=SUM($L$7:L11)
Is there a fix?
Hello Kris!
If you are working with an ever-changing dataset, you may want to make the range dynamic. This means that it automatically expands to accommodate newly added records. You can find the examples and detailed instructions here: How to create and use dynamic named range in Excel.
Editing a spreadsheet that has a cumulative sum column
I have a spreadsheet into which I have entered a series of transactions, and alongside each transaction amount I have a formula which gives the running total.
Lets say, at some point in the future, I notice that the order of the transactions is incorrect and I need to move one of them up to its correct position. So I insert a blank row at the appropriate point and I can then copy the transaction that is in the wrong place into this blank row, and then delete the original row. This works fine.
However, I had expected to be able to MOVE the transaction into the blank row by dragging, rather than COPY it and delete the original. When I MOVE the transaction, the relative reference does not update.
For example if row 4 has a cumulative total formula of =SUM($B$2:B4), and row 7 has a cumulative total formula of =SUM($B$2:B7), and I want to move the current row 7 transaction into the position currently occupied by the row 4 transaction, if I use "copy and delete", the formula copied from what was row 7 has its formula correctly changed to =SUM($B$2:B4) to reflect its new position.
If, instead I MOVE the row, then I end up with the formula =SUM($B$2:B8) in row 4. The relative reference has not been updated. (The reason it is now 8 not 7 is because it was updated when I added the new row at 4.)
Obviously it is no great hardship having to use "copy and delete", but I have to do this row rearrangement quite often, and I find myself using the MOVE method by mistake and then wondering why my spreadsheet is wrong.
Does anyone have any suggestions?
Hi! Maybe this article will be helpful: How to copy formula in Excel with or without changing references.
I am struggeling with sub totals with a sheet,could someone please guide me?
A have a number of columns, C is the equipment value, D is for damage, E fees and F Gross claim. We will pay all claims from a fund worth R1,500,000 after which the insurers will pay the balance, but all claims above a R250,000 cap will also be paid by the insurers.
The Fund depleting sum is "=SUM(IF(H8,MAX(IF(AND(H8>0,I8>0),J7-I8,J7-H8),0),0))", but the cap, the column priod to the fund's formula is "=MAX(IF(J14>$I$6,IF(AND(H15>0,H15$I$6,$I$6,H15)),$I$6-H15),0)". This particular formula carry on line by line down the sheet showing 250,000 which means my totas "Insurers Pay" formula and We pay do not realy add up properly.
Can I send the sheet as an example?
Without seeing your data, it is impossible to understand your formulas. In addition, the formulas contain references to columns that are not specified in your question. Please clarify your specific problem or provide additional details to highlight exactly what you need.
Great information here.
This is probably a simple one for the illuminati:
Suppose column C tracks profit gain and column D tracks profit losses. What would be the formula for column E tracking the ongoing balance?
It seems like it should be =SUM($C$2:C2)-SUM($D$2:D2) but I've apparently missed something.
Hi! If you copy this formula down the column, you will get the running profit total. To get just the profit total, change the cell references in the SUM formula. For example,
=SUM($C$2:C20)-SUM($D$2:D20)
How do I calculate the average of the total month at day 1, day 2, day 3 etc?
Hi!
If I understand your task correctly, you can use the AVERAGEIFS function and specify the desired days as the criteria.
Hi,
Thanks for the post.
I am trying to track if an event occurs more than 4 times per month (31 days?). Once the count is more than 3, I will use conditional formatting to color the cell. I have tried manipulating some SUMIF formulas, but I am very stuck.
Thus, I want to have a running total or occurrences, only if they occurred within a 31day bracket, continually.
A B C
Dates Did the event occur? "1" for yes, blank for no. Running Total of how many times the event occurred, in the past 31days.
2/10/2022 1 1
2/10/2022 1 2
15/10/2022 1 3
15/10/2022 1 4
16/10/2022 1 5
5/11/2022 1 4 (this is because now, the occurrences on 2/10 are more than 31 days ago)
7/11/2022 1 5
10/11/2022 5
10/11/2022 1 6
10/11/2022 1 7
10/11/2022 1 8
16/11/2022 1 7
11/12/2022 1
22/12/2022 0
24/12/2022 0
28/12/2022 1 1
29/12/2022
29/12/2022
29/12/2022
Any help is appreciated. Thanks.
Thanks for the post.
I am trying to track if an event occurs more than 4 times per month (31 days?)
Thus, I want to have a running total or occurrences, only if they occurred within a 31day bracket, continually.
A .......................B.....................................................................................C
Dates................Did the event occur? "1" for yes, blank for no..............Running Total of how many times the event occurred, in the past 31days
2/10/2022.........1.....................................................................................1
2/10/2022.........1.....................................................................................2
15/10/2022.......1.....................................................................................3
15/10/2022.......1.....................................................................................4
16/10/2022.......1.....................................................................................5
5/11/2022.........1.....................................................................................4.(this is because now, the occurrences on 2/10 are more than 31 days ago)
7/11/2022.........1.....................................................................................5
10/11/2022..............................................................................................5
10/11/2022......1......................................................................................6
10/11/2022......1......................................................................................7
10/11/2022......1......................................................................................8
16/11/2022......1......................................................................................7
11/12/2022..............................................................................................1 (this is because there has been no occurrence since 11/11)
22/12/2022..............................................................................................1
24/12/2022..............................................................................................1
28/12/2022.......1.....................................................................................2
29/12/2022
29/12/2022
29/12/2022
Any help is appreciated. Thanks.
Sorry, realized I had manually added the occurrences wrong - shows why I want to automate it.
Thanks for the post.
I am trying to track if an event occurs more than 4 times per month (31 days?)
Thus, I want to have a running total or occurrences, only if they occurred within a 31day bracket, continually.
A .......................B.....................................................................................C
Dates................Did the event occur? "1" for yes, blank for no..............Running Total of how many times the event occurred, in the past 31days
2/10/2022.........1.....................................................................................1
2/10/2022.........1.....................................................................................2
15/10/2022.......1.....................................................................................3
15/10/2022.......1.....................................................................................4
16/10/2022.......1.....................................................................................5
5/11/2022.........1.....................................................................................4.(this is because now, the occurrences on 2/10 are more than 31 days ago)
7/11/2022.........1.....................................................................................5
10/11/2022..............................................................................................5
10/11/2022......1......................................................................................6
10/11/2022......1......................................................................................7
10/11/2022......1......................................................................................8
16/11/2022......1......................................................................................7
11/12/2022..............................................................................................4 (this is because there has been only 4 occurrence since 11/11)
22/12/2022..............................................................................................1
24/12/2022..............................................................................................1
28/12/2022.......1.....................................................................................1
29/12/2022
29/12/2022
29/12/2022
Any help is appreciated. Thanks.
Hello!
To calculate a running total by condition, try this formula.
=SUM(($B$1:B2=1)* (IFERROR(DATEDIF($A$1:A2,A2,"D")>=0,0))* (IFERROR(DATEDIF($A$1:A2,A2,"D")<=31,0)))
You can learn more about calculating date diference in this article: Excel DATEDIF function to get difference between two dates.
Hi I'm trying to get a running accm. total for revenue over various sheets on an excel file. For each week I get the revenue and the following week I get another total and I want to keep adding them together as I pull new sheets. How would I do that?
for example;
sheet one -- total revenue
sheet two -- total revenue +total revenue of sheet one
sheet three -- total revenue + (sheet two total revenue + sheet one total revenue)
sheet four -- total revenue + (sheet three total revenue + sheet two total revenue + sheet one total revenue)
Hi!
Here is the article that may be helpful to you: 3-D reference in Excel: reference the same cell or range in multiple worksheets.