Fixed running total

bizmark222

New Member
Joined
Jun 18, 2019
Messages
12
Hi
I know how to total sum cells together but-
I need for example, if f5,f6,f7 = 1 (f5 has 1 in it) and i change the value in f5 back to 0 the sum total stay fixed at 1, so if f6 was to show 3 it would =4 and keep an ongoing total regardless of numbers changing back to 0 in above cells, make sense?
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Thats not how spreadsheets work im afraid. If you wanted to keep a total somewhere you could use code but a formula isnt going to do it.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)

Dim rng As Range, c As Range

Set rng = Intersect(Range("F5:F7"), Target)

If Not rng Is Nothing Then
    For Each c In rng
        If IsNumeric(c) Then
            Range("F8").Value = Range("F8").Value + c.Value
        End If
    Next
End If

End Sub

Place that in the worksheet module. Right click sheet tab. View code. Paste in the code in the white space.
 
Upvote 0
Thank you for your help!
it works but the values in F5-F7 have a formula in them that triggers a 1 for true and 0 for negative.
Its these that I need a fixed running total for. The values do change but F8 will not add them up, is there any way around this?
 
Upvote 0
Are the values in E5:E7 hard values or formulae?
 
Upvote 0
Are those formulae looking at other formulae, or hard values & are they looking at cells on another sheet/workbook?
 
Upvote 0
Cross posted https://www.excelforum.com/excel-formulas-and-functions/1279807-fixed-running-total.html

While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules).
This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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