HP17bII+ Solver - Payback Period formula - Printable Version +- HP Forums (https://archived.hpcalc.org/museumforum) +-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html) +--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html) +--- Thread: HP17bII+ Solver - Payback Period formula (/thread-153562.html) |
HP17bII+ Solver - Payback Period formula - RMIER - 07-27-2009 Here is an accurate but long first attempt at a payback period formula for the HP17bII+ Solver. If anyone has a shorter, more elegant version please feel free to share. Background: Payback Period is number of years required to recover the invested capital in terms of free cash flows. By definition it ignores time value of money hence it is less useful than IRR and NPV, but it is sometimes used. http://www.investopedia.com/terms/p/paybackperiod.asp For example, an investment of -$300,000 (Cash Flow 0) that generates free cash flows of $200,000 in Year 1 (Cash Flow 1) and $160,000 in year 2 has a payback period of 1.625 years (wish all my investments were like this). In other words, it takes the entire first year and a fraction of the second year to recover the investment. The fraction of the second year is given by: (absolute value of accumulated cash flow Year 1/Cash Flow Year 2), or ($100,000/$160,000) = 0.625 Notes:
- Cash flow list has been named "CFLIS". FIN - CFLO - NAME - CFLIS Here we go:
PAYBK=L(S1:FLOW(CFLIS:0)+FLOW(CFLIS:1))*0+
IF(S1>=0:1-(S1/FLOW(CFLIS:1)): Re: HP17bII+ Solver - Payback Period formula - Katie Wasserman - 07-28-2009 Wow, that's a long equation. Disclaimer: I wrote and tested this on a 17bii not a 17bii+ Here's a simpler, more general solution that will work for any length cash flow list and follows your assumptions. It's doesn't stop at year 16 however.
PAYBK = - Sigma is the summation symbol on the 17BII - G(..) simply gets the value of the variable but does it without trying to solve for it and without showing it as a variable in the menu.
Edited: 28 July 2009, 1:06 a.m.
Re: HP17bII+ Solver - Payback Period formula - Marcus von Cube, Germany - 07-28-2009 Katie, the problem is the case where the sum of cash flows is negative. The formula will spit out the number of cash flows but no error indication is given.
Re: HP17bII+ Solver - Payback Period formula - Marcus von Cube, Germany - 07-28-2009 Your formula doesn't check the total number of cas flows and will (probably, I haven't checked) error out if the sum of all cash flows is negative.
Re: HP17bII+ Solver - Payback Period formula - Katie Wasserman - 07-28-2009 That's correct, there's no check to see if total doesn't end up as a positive number and therefore it will just terminate showing the total number of cash flows. But it's simple to correct that:
PAYBK = The above formula will return a 9E499 if the sum of the cash flows never turns positive.
Re: HP17bII+ Solver - Payback Period formula - RMIER - 08-02-2009 Katie, thanks for the elegant and short solution, clever use of sigma, SIZEC and G(X) to get the job done. It works well on the 17bII+. Marcus, thanks for your comment also, it resulted in an improvement to the solution.
Much appreciated, Rafael.
Re: HP17bII+ Solver - Payback Period formula - Peter A. Gebhardt - 08-02-2009 In addition to Katie's solution, here is my Discounted Payback Solution (from a 200LX) which takes into account that: 1) SAF% == 0 (Opportunity Cost per Period) results in Payback Periods instead of Discounted Payback Periods 2) Grouped CFs are possible
0*SAF% To reduce the number of characters to be typed into your 17bII+ finetuning of the above code should be possible still. As examples: Somebody might reduce the code in the init section or might play around with some clever MIN/MAX usage instead of IF's ... Best regards, Peter A. Gebhardt PS (3-Aug-2009,10:46 MESZ): The following code, which was thought of covering the case of sum of the CFs being negative, gave spurious erroneous results.
Therefore I replaced -if(G(DPB$)<0:L(D:9E99):G(D))
Edited: 3 Aug 2009, 4:56 a.m.
|