sgt Fury
sgt Fury

Reputation: 170

Cummulative sum in Excel with statment

I have a trouble!
For example: I have one column "A" with values: 0, 1, 1, 1, 0 etc. And in the "B" column must contain cummulative sum of zeroes. If there will be zero the cummulative sum resets its value.
For example:
A: 0, 1, 1, 1, 1, 0, 1, 1 etc.
B: 0, 1, 2, 3, 4, 0, 1, 2 etc.

Upvotes: 0

Views: 64

Answers (1)

Gary's Student
Gary's Student

Reputation: 96763

IN B1 enter:

=A1

In B2 enter:

=IF(A2=0,0,A2+B1)

and copy down

Upvotes: 1

Related Questions