stick on cumulative summing and counting....hard one...

S

Sam

Hey Guys, need some greater minds than mine to help me out....

so I need it to cumulatively sum the 1's in column a but the moment there
is a 0 it needs to stop summing.Then once there is a 1, start the process
from 1 again. This is going from the bottom to the top by the way.

I NEED THIS
COLUMN BELOW
(B) BUT CAN'T
WORK OUT THE
RIGHT FORMULA

THIS COLUMN (C)
IS MY FIRST TRY..
BUT CAN'T GET IT
TO RESTART THE
SUM PROPERLY

A B C

1 4 13
1 3 13
1 2 12
1 1 11
0 0 10
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
1 2 0
1 1 9
0 0 8
0 0 0
1 2 0
1 1 7
0 0 6
0 0 0
0 0 0
0 0 0
1 6 0
1 5 5
1 4 4
1 3 3
1 2 2
1 1 IF(B32>0,SUM(B32:B$32),0)


much appreciated anyone? This could also be in VBA if anyone prefers?
 
L

Luke M

In B2:
=IF(A2=0,0,A2+B3)

Copy down as far as needed.
Sometimes, the simple things work best. =)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top