### Sum row cells until value is reached

Hello, I would really appreciate if someone could help me with example attached. I need formula that sums up values in row (from column A to column G) while max sum (column I) is less or equal to max value (column H). Thank you, Petra

chandoo.org

So what I need help with is this.

A B

1 HDR1 HDR2

2 15

3 75

4 178

5 240

6 21

7 97

Given a column like column A, how to walk down the column starting at A2, happily summing all the way like one of the 7 dwarfs until the summed N-cells value pushes the sum over 1000. If possible, make those rows into a group or at worst, put a value into another column that can somehow be used to create a group in a later step. Then start over or continue to 2000, group, rinse and repeat every 1K until no more rows have a value that can be added to the summing process.

I sure hope that makes some sense cause with the way search terms are being returned by Google these days I am not finding a lot of help there.

If not, thanks for giving this a glance at least.