When cell reaches equal to or over a sum, start new sum

Closed
madsen_12001 Posts 1 Registration date Monday January 16, 2017 Status Member Last seen January 16, 2017 - Updated by madsen_12001 on 16/01/17 at 12:15 PM
Hello,

I have numbers in columns A through C that are input manually row by row, and column D provides a sum of each row's numbers and adds the previous rows' sums together for a combined total. Whenever column D hits equal to or over a sum of 680, I need it to reset the sum formula for the next row because every 680 supplies, we must throw away. For an example:

~~~A B C D
1 10 10 10 30
2 50 50 50 180 (50+50+50+30)
3 200 200 200 780 (200+200+200+180)
4 10 10 10 30 (reset because row 3 column D is over 680)

Any help is appreciated, thanks!