Some answers depend on everything before them: a running stock level, a running balance, the lowest point so far. REDUCE and SCAN handle these with an accumulator, a value carried from one row to the next.
=SCAN(35, C2:C13, LAMBDA(stock, change, stock+change))
The first argument is where the accumulator starts. The LAMBDA has two parameters: the accumulator so far, and the current value. Whatever it returns becomes the accumulator for the next value.
- SCAN returns every step, one per value, so it spills a running column.
- REDUCE returns only the last step, one value.
Pick the starting value with care. A running total starts at 0 or an opening balance. A running minimum can't start at 0, because MIN(0, anything positive) is always 0: start it from the first value instead. The accumulator can also restart, for example back to 0 whenever a delivery arrives.
=SCAN($G$1, C2:C13, LAMBDA(stock, change, stock+change))
=REDUCE(0, C2:C13, LAMBDA(out, c, IF(c<0, out-c, out)))
Stock after every movement; units shipped out in total.