hey guys, thanks for all the help with the loop problem...part deu

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?
 
M

Matthew Herbert

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 GETIT
                             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?

Sam,

Why not use the SUMIF function? And if your column has 1s and 0s only
then simply do a SUM.

=SUMIF(A1:A8,1,A1:A8)

Best,

Matthew Herbert
 

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