PO.ECON.Payout


Description

The month in which cumulative cash flow climbs back to zero after its low point: the undiscounted payout. The cumulative cash flow is found with SCAN. Its low point is the trough, where the capital outlay is deepest; payout is the first month after the trough in which the cumulative is zero or more. Counting from the trough, not from the start, means early revenue before a later capital phase does not count as payout. The LAMBDA returns the month's position in the column (the first month is 1), and the text "none" when the cumulative never climbs back to zero.

Formula

=LAMBDA(cash,LET( cumulative,SCAN(0,cash,LAMBDA(running,flow,running+flow)), trough,MATCH(MIN(cumulative),cumulative,0), IFERROR(MATCH(1,(SEQUENCE(ROWS(cumulative))>trough)*(cumulative>=0),0),"none")))

Parameters

Parameter Unit Description
cash currency Monthly cash flows, first month first, as a column

Examples

Invocation Expected
=PO.ECON.Payout({-1000;-500;400;400;400;400}) 6
=PO.ECON.Payout({-300;100;100;100}) 4

Need a custom LAMBDA? Suggest a New Lambda