(12C) Payback Period in Cash Flows
03-25-2018, 06:20 AM
Post: #1
 Carsen Member Posts: 195 Joined: Jan 2017
(12C) Payback Period in Cash Flows
This program calculates the payback period in a cash flow, regardless of whether it is even or uneven. The result appears in the x-register. Whatever unit of time you use for N is what is used for Payback period so keep that in mind. Also, you can still execute cash flow functions after running the program.

This was certainly a challenging program because with cash flows on the 12C, pretty much all of the registers are used!

The program is written in a very neat format in PDF form. It also has an example and a procedure at the end. And yes, I wrote the program myself.

Any suggestions, comments, questions, requests, & critiques? Post them below.

Attached File(s)
03-25-2018, 06:23 AM
Post: #2
 Carsen Member Posts: 195 Joined: Jan 2017
RE: (12C) Payback Period in Cash Flows
It would also be radical if somebody could post how long the program takes to get the answer on the original 12C. Please and thank you.
03-25-2018, 04:19 PM
Post: #3
 rprosperi Senior Member Posts: 4,106 Joined: Dec 2013
RE: (12C) Payback Period in Cash Flows
Carsten - thanks for sharing, and for all the effort to make such a nice and clear program listing.

I've entered it on an old 12C (not sure what you mean by 'original' since various h/w versions vary in speed up to 1000 times), in this case a USA-made machine from 1988. But I am not getting the expected results, even though I've verified the program listing.

So, perhaps my confusion stems from the user instructions.

1. Do you really enter the initial investment before the cashflows? I believe it will get pushed off the top of the stack.

2. Suggest you provide exact key sequences in your example as many folks (maybe including me) are not familiar with the proper way to enter cash flows.

I assume something like:

14000 [g][CF0]
11000 [g][CFj]
10000 [g][CFj]
10000 [g][CFj]
10000 [g][CFj]
9100 [g][CFj]
etc.

but as I said, I don't have a lot of experience entering cash flows, so maybe this is wrong.

If you can clarify the instructions, I'm happy to time this for you.

Note I have verified I've entered the program correctly (per your listing), but I'm waiting for Dieter to suggest how to take 5-6 steps out of it; he always seems to find a way, and I nearly always learn a little when he does.

--Bob Prosperi
03-25-2018, 09:23 PM
Post: #4
 Carsen Member Posts: 195 Joined: Jan 2017
RE: (12C) Payback Period in Cash Flows
Well that's embarrassing ;-). Let me rephrase that.

"It would also be radical if somebody could post how long the program takes to get the answer on a classic HP-12C made in the 1980's."

Okay. Here's how the cash flow (CF) problem would be entered into the 12C.

[ f ] CLEAR REG
-79,000 [ g ] [CF0] Stores the initial investment. The initial investment is in the description above the table. Initial investment starts in year 0.
14,000 [ g ] [CFj] Year 1 CF
11,000 [ g ] [CFj] Year 2 CF
10,000 [ g ] [CFj] You get the idea
3 [ g ] [Nj] The CF of $10,000 appears a consecutive number of 3 times. 9,100 [ g ] [CFj] 9,000 [ g ] [CFj] 2 [ g ] [Nj] 4,500 [ g ] [CFj] 100,000 [ g ] [CFj]. Then press [R/S]. Answer should be 7.66 yrs. 03-26-2018, 12:33 AM Post: #5  rprosperi Senior Member Posts: 4,106 Joined: Dec 2013 RE: (12C) Payback Period in Cash Flows (03-25-2018 09:23 PM)Carsen Wrote: Well that's embarrassing ;-). Let me rephrase that. "It would also be radical if somebody could post how long the program takes to get the answer on a classic HP-12C made in the 1980's." Okay. Here's how the cash flow (CF) problem would be entered into the 12C.... That helps a lot, thanks for clarifying the data entry steps. On the '88 12C (same underlying h/w as when introduced), it takes about 8 seconds to produce the proper answer. I ran it 3 times to verify. Unfortunately, there is no TEVAL on a 12C, so it has to be measured by eye with a watch next to the machine. Was this better or worse than you expected? Suggestion: Update the PDF with these operating steps, as most folks will just grab the PDF and try it later, and no doubt some will be confused like I was... you know, us non-finance guys. --Bob Prosperi 03-26-2018, 11:58 AM Post: #6  Dieter Senior Member Posts: 2,397 Joined: Dec 2013 RE: (12C) Payback Period in Cash Flows (03-25-2018 04:19 PM)rprosperi Wrote: Note I have verified I've entered the program correctly (per your listing), but I'm waiting for Dieter to suggest how to take 5-6 steps out of it; he always seems to find a way, and I nearly always learn a little when he does. Thank you, but I am not that familiar with the financial functions of the 12C. I always did such things on an HP41. ;-) And finally Carsen's code looks quite good to me. Dieter 03-26-2018, 10:17 PM Post: #7  Carsen Member Posts: 195 Joined: Jan 2017 RE: (12C) Payback Period in Cash Flows (03-26-2018 12:33 AM)rprosperi Wrote: On the '88 12C (same underlying h/w as when introduced), it takes about 8 seconds to produce the proper answer. I ran it 3 times to verify. Unfortunately, there is no TEVAL on a 12C, so it has to be measured by eye with a watch next to the machine. Was this better or worse than you expected? Suggestion: Update the PDF with these operating steps, as most folks will just grab the PDF and try it later, and no doubt some will be confused like I was... you know, us non-finance guys. I had a guess of about 10 seconds. I have experience with a 1987 HP-15C so I had a pretty good guess of how fast a 1980's HP-12C would be. I requested a speed test simply because of my curiosity. Thanks a lot. I'll take your suggestion and upload a new version. I originally intended the file to be only for me but now that I decided to share it, I'll rewrite to be user-friendly. And I'll try to reduce some steps too. 03-27-2018, 01:49 AM (This post was last modified: 03-27-2018 04:47 AM by Gamo.) Post: #8  Gamo Senior Member Posts: 597 Joined: Dec 2016 RE: (12C) Payback Period in Cash Flows This program is very good and very helpful. I try one of the example from the 12C User's Handbook on how to calculate NPV and this same problem can also check to see the Payback Period too. Example: An investor has an opportunity to buy a duplex for$80,000 and
would like a return of at least 13%. He expects to keep the duplex 5 years and
then sell it for \$130,000; and he anticipates the cash flows shown in the diagram
below. Calculate NPV to determine whether the investment would result in a return or a loss.

CF0 -80,000
CF1 -500
CF2 4,500
CF3 5,500
CF4 4,500
CF5 130,000

NPV is 212.18 since NPV is positive investment would increase the financial value

Now I use "Payback Period in Cash Flows" program just continue with [R/S]

Gamo
11-27-2018, 04:32 PM
Post: #9
 aiko Junior Member Posts: 1 Joined: Nov 2018
RE: (12C) Payback Period in Cash Flows
Does anyone know how to calculate dpp on hp 12c?
06-10-2019, 09:41 PM
Post: #10
 Joe_H Junior Member Posts: 23 Joined: Jun 2019
RE: (12C) Payback Period in Cash Flows
(11-27-2018 04:32 PM)aiko Wrote:  Does anyone know how to calculate dpp on hp 12c?

Aiko

I have just posted a new thread with title '(12C) Discounted Payback Period Program' (it is in moderation but hopefully will posted shortly so I don't have a link to it). I have all the details and program in an attachment you can download. It ended up being a bit shorter than Carson's at 41 steps and it can do discounted or simple payback period calculations for even or uneven cashflow sequences.

Entering cashflows is as Carson describes and n has to have the correct value as per the cashflow entry (auto generated) and i the discount rate (0 for simple) and finally the total number of periods in the cashflow (bigger than n if some Nj's greater than 1) has to be in the display before calling the program. It executes in less than a second on my HP12C.

Joe
06-11-2019, 06:40 PM
Post: #11
 Carsen Member Posts: 195 Joined: Jan 2017
RE: (12C) Payback Period in Cash Flows
Hi Joe:

Good work with your discounted payback period program. It has more functionality than mine because it does regular & discounted payback period. It even uses less memory by saving 18 programming lines. That a lot of memory saved for a 12C (not the 12C Platinum though lol).

I used your program 3 other cash flows and everything works. It's even documented in a pdf file, similar to what I do. Good work!

Best,

Carsen
 « Next Oldest | Next Newest »

User(s) browsing this thread: 1 Guest(s)