Here is another way: With[{acc = Accumulate@data}, acc[[;; -#]] ~Join~ data[[-# + 1 ;;]] &@Count[acc, _?Positive]] (* {-1050, -1000, 1, 1950, 1950, 1950, 525, 0} *) You can also use `Tr@Boole@Thread[acc > 0]]` instead of `Count[...]` or if you want `≥0`, then you can use `Tr@UnitStep[acc]`.