Today’s function is PAYBACK. It calculates the length of time required for an investment to recover its initial outlay.
=LAMBDA(cashflows,
LET(
cumCF,SCAN(0,cashflows,SUM),
period,XMATCH(0,cumCF,1)-1,
periodCF,INDEX(cumCF,period+1)-INDEX(cumCF,period),
periodFraction,1+INDEX(cumCF,period)/periodCF,
paybackPeriod,period-periodFraction,
result,IF(INDEX(cumCF,1,1)>=0,0,paybackPeriod),
result))
ليست هناك تعليقات:
إرسال تعليق