Home > OS >  An ARRAYFORMULA formula that adds but resets the result before a certain number is exceeded
An ARRAYFORMULA formula that adds but resets the result before a certain number is exceeded

Time:02-02

enter image description here

Accumulates the numeric values in the left column and returns them to the cells in the right column of the same row. However, it should not exceed 6. If the value exceeds 6 when added, the accumulated value is initialized and added again. Repeat this process.

I'd like to get this to work with the spreadsheet's formula function. But this is too complicated...

CodePudding user response:

Given your numeric values in F2 downwards as shown, enter the following in G2:

=scan(,F2:F,lambda(acc,arr,if(arr="",,if(acc arr<6,acc arr,arr))))
  • Related