I have a table with 2 columns: input and length. Make a copy of the example sheet.
The Ask
I want to output the row numbers in a single formula if the accumulated sum of the "Length" B2:B is the closest to 30, Reset the sum, and do the same.
the desired result is shown in C2:C
Example
C2 = sum of $C1:C1 is 8 and sum of $C1:C2 is 18 >>>> Do Nothing
C3 = sum of $C1:C2 is 18 and sum of $C1:C3 is 28 >>> Do Nothing
C4 = sum of $C1:C3 is 28 and sum of $C1:C4 is 36>>> output the row number 4
---because the following cell C4 sum $C1:C4 is => 30
C4 = sum of $C1:C4 is 36 "equal or exceeded 30 so reset the sum">>>

