Sum Up Numbers w/o Breaks

C

c_schear

Heres kinda how my spreadsheet looks:

Code
-------------------

A B C D
1. Disc Cost Adj Result
2. Sample1 $1.00 -1 -$1.00
3. Sample2 $5.00 -5 -$25.00
4. Sample3 $1.00 -1 -$1.00
5.
6. Sample1 $1.00 -1 -$1.00
7. Sample1 $1.00 -1 -$1.00
8.

-------------------


What I need is all the cells in row "D" to multiply C*B (easy), but i
there is nothing in C, then I need it to sum up the values in D (from
above it to the next break in numbers). So D5 would = -$27.00, and D
would = -$2.00. This is what I have come up with so far (D5):


Code
 
H

hgrove

c_schear wrote...
Heres kinda how my spreadsheet looks:

A B C D
1 Disc Cost Adj Result
2 Sample1 $1.00 -1 -$1.00
3 Sample2 $5.00 -5 -$25.00
4 Sample3 $1.00 -1 -$1.00
5
6 Sample1 $1.00 -1 -$1.00
7 Sample1 $1.00 -1 -$1.00
8.

What I need is all the cells in row "D" to multiply C*B (easy), but i there is
nothing in C, then I need it to sum up the values in D (from 1 abov it to the
next break in numbers). So D5 would = -$27.00, and D8 would = -$2.00
. . .
...

If you want the same formulas for all cells in column D from cell D
down, try

D2:
=IF(ISNUMBER(C2),B2*C2,SUM(INDIRECT("R"&
LOOKUP(2,1/(1-ISNUMBER(C$1:C1)),ROW(C$1:C1)+1)&"C:R[-1]C",0)))

filled down as far as needed
 
F

Frank Kabel

Hi
try the following formulas
D1:
=B1*C1
D2:
=IF($C2<>"",$B2*$C2,SUM(OFFSET($D1,0,0,-ROW()+1+SUMPRODUCT(MAX(($C$1:$C
1="")*ROW($C$1:$C1))))))

and copy this down
 

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

Similar Threads


Top