Cumulative Sum

rbobcat1

New Member
Joined
Dec 19, 2011
Messages
19
Office Version
  1. 365
Platform
  1. Windows

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
You need to use absoluting.

Something like:

D2: =Sum(D$2:D2)

then drag down The $ tells it not to increment that reference.
 
Upvote 0
You need to use absoluting.

Something like:

D2: =Sum(D$2:D2)

then drag down The $ tells it not to increment that reference.
that does not keep a cumulative total of how many i have collected in c2 if i change b2.
 
Upvote 0
Oh my mistake, so when you update something you want the total to equal its original value PLUS the new value?

In such a case you will need to use a sheet level macro using the worksheet_change event. Easy enough to do but quite open to error (ie if you enter something wrong then type over it again both the wrong and the correct amounts will be added)
 
Upvote 0
Right click on the tab and choose "View code"

Paste this in:

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row = 2 And Target.Column = 2 Then Range("C2").Formula = Range("C2").Value + Range("B2").Value
End Sub
 
Upvote 0
That worked, Great, now if i want it to for other rows i just change the row reference?
 
Upvote 0
Yeah but you could give it a range like this:

If target.row > 1 and target.row < 11 and Target.column = 2 then blah blah

That will work on rows 2 to 10 for column B

Edit: You need to change the reference for posting the data to also, try this:

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row > 1 And Target.Row < 11 And Target.Column = 2 Then Range("C" & Target.Row).Formula = Range("C" & Target.Row).Value + Range("B" & Target.Row).Value
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,246
Members
452,623
Latest member
cliftonhandyman

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top