View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
joeu2004 joeu2004 is offline
external usenet poster
 
Posts: 2,059
Default Variable Sum Function

On Dec 26, 7:06 pm, David G. wrote:
I want the cummlative (Column B cells) to count up
to deliveries. When the accumulation reaches the
1st quantity to be delivered (A8=35) The cell zeroes
out, adds any excess and restarts the accumulation
for the second delivery (A9=49).


There may be a more efficient way to do this. But
for one solution, enter the following into B2 and
copy down:

=B1 + A2
- IF(SUM($A$1:A1)<$B$9, $B$8*(B1=$B$8), $B$9*(B1=$B$9))

(I assume that B1 is simply =A1.)

Note: Be sure this gives the desired results when
A4 is 13 and A5 is 14. You will understand why when
you try it.


----- original posting -----

On Dec 26, 7:06*pm, David G. wrote:
Sorry about the confusion. The table was not consistent with what I tried to
explain.

What I have in column A are units produced per day. Column B is a
cummulative sum. *I want the cummlative (Column B cells) to count up to
deliveries. *When the accumulation reaches the 1st quantity to be delivered
(A8=35) The cell zeroes out, adds any excess and restarts the accumulation
for the second delivery (A9=49).

The corrected table should look like this:

* * * * A * * * B
1 * * * 15 * * *15
2 * * * 32 * * *47
3 * * * 10 * * *22
4 * * * 25 * * *47
5 * * * 4 * * * 51
6 * * * 13 * * *15
7
8 * * * * * * *35
9 * * * * * * *49