I am trying to setup a spreadsheet to track a number of values. I only need to create a running total when the total of 2 columns becomes a positive value and then track it back down to when it moves back to a negative. The data looks like this:
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]Value A[/TD]
[TD]Value B[/TD]
[TD]A + B[/TD]
[TD]Required Result[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]-2000[/TD]
[TD]-2000[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]-3500[/TD]
[TD]-3500[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]41000[/TD]
[TD]-11000[/TD]
[TD]30000[/TD]
[TD]30000[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]-1600[/TD]
[TD]-1600[/TD]
[TD]28400[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]-1800[/TD]
[TD]-1800[/TD]
[TD]26600[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]-11800[/TD]
[TD]-11800[/TD]
[TD]14800[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]-6000[/TD]
[TD]-6000[/TD]
[TD]8800[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]-10000[/TD]
[TD]-10000[/TD]
[TD]-1200[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]-5000[/TD]
[TD]-5000[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]20000[/TD]
[TD]-5000[/TD]
[TD]15000[/TD]
[TD]15000[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]-8000[/TD]
[TD]-8000[/TD]
[TD]7000[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]-5000[/TD]
[TD]-5000[/TD]
[TD]2000[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]-6500[/TD]
[TD]-6500[/TD]
[TD]-4500[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]-3300[/TD]
[TD]-3300[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]-9800[/TD]
[TD]-9800[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]-5300[/TD]
[TD]-5300[/TD]
[TD]0[/TD]
[/TR]
</tbody>[/TABLE]
I feel like there is an easy solution that I am just missing by nesting IF loops or something along those lines, I have tried with extra columns but I am missing something. Creating a running total isn't hard but having it reset is the problem.
Any ideas are gratefully received!
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]Value A[/TD]
[TD]Value B[/TD]
[TD]A + B[/TD]
[TD]Required Result[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]-2000[/TD]
[TD]-2000[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]-3500[/TD]
[TD]-3500[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]41000[/TD]
[TD]-11000[/TD]
[TD]30000[/TD]
[TD]30000[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]-1600[/TD]
[TD]-1600[/TD]
[TD]28400[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]-1800[/TD]
[TD]-1800[/TD]
[TD]26600[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]-11800[/TD]
[TD]-11800[/TD]
[TD]14800[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]-6000[/TD]
[TD]-6000[/TD]
[TD]8800[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]-10000[/TD]
[TD]-10000[/TD]
[TD]-1200[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]-5000[/TD]
[TD]-5000[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]20000[/TD]
[TD]-5000[/TD]
[TD]15000[/TD]
[TD]15000[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]-8000[/TD]
[TD]-8000[/TD]
[TD]7000[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]-5000[/TD]
[TD]-5000[/TD]
[TD]2000[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]-6500[/TD]
[TD]-6500[/TD]
[TD]-4500[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]-3300[/TD]
[TD]-3300[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]-9800[/TD]
[TD]-9800[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]-5300[/TD]
[TD]-5300[/TD]
[TD]0[/TD]
[/TR]
</tbody>[/TABLE]
I feel like there is an easy solution that I am just missing by nesting IF loops or something along those lines, I have tried with extra columns but I am missing something. Creating a running total isn't hard but having it reset is the problem.
Any ideas are gratefully received!