HP Forums

Full Version: (12C) Discounted Payback Period Program
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
For the CFA exams one of the reasons most commonly quoted for preferring the TI BA II is that the HP12C cannot do discounted payback calculations (or simple ones either). In another thread (https://www.hpmuseum.org/forum/thread-10385.html) Carson has written a program to do payback calculations and I had mistakenly thought at first they were discounted ones but they are simple payback periods only. I therefore set out to write such a program and it is now working successfully.

It is a challenging program to write as none of the TVM registers can be used (they are required for the NPV calculations the programs uses) or the R registers as these may be used for the cashflow sequence itself. Therefore, the only available registers are X, Y, Z and L (T isn't used).

The program uses n for the cashflow sequence (auto generated when cashflow is entered), i for the discount rate and the X register (display) has to have the total number of payments in the sequence (excl. CF0). The program takes into account the Nj values at each step in the cashflow sequence.

The program can do discounted or simple payback calculations. For simple payback period just set i to zero.

If redoing the calculation (say simple first and then discounted or different discount rates) Nj values greater than 1 may have to be reset to the correct value and n will have to be reset. It is quick and easy to reset these when you're familiar with entering and editing cashflow sequences on the HP12C (need to be for CFA exams).

I have a 3rd edition HP12C (Chinese one 2 cells model HSTNJ-KN05 same as 30th anniv edition but that text isn't on the face purchased around 2010/11) and it runs on lengthy cashflows in well less than a second.

The program and other details are in the attached pdf. Let me know how you get on with it.
(06-10-2019 09:32 PM)Joe_H Wrote: [ -> ]For the CFA exams one of the reasons most commonly quoted for preferring the TI BA II is that the HP12C cannot do discounted payback calculations (or simple ones either). In another thread (https://www.hpmuseum.org/forum/thread-10385.html) Carson has written a program to do payback calculations and I had mistakenly thought at first they were discounted ones but they are simple payback periods only. I therefore set out to write such a program and it is now working successfully.

It is a challenging program to write as none of the TVM registers can be used (they are required for the NPV calculations the programs uses) or the R registers as these may be used for the cashflow sequence itself. Therefore, the only available registers are X, Y, Z and L (T isn't used).

The program uses n for the cashflow sequence (auto generated when cashflow is entered), i for the discount rate and the X register (display) has to have the total number of payments in the sequence (excl. CF0). The program takes into account the Nj values at each step in the cashflow sequence.

The program can do discounted or simple payback calculations. For simple payback period just set i to zero.

If redoing the calculation (say simple first and then discounted or different discount rates) Nj values greater than 1 may have to be reset to the correct value and n will have to be reset. It is quick and easy to reset these when you're familiar with entering and editing cashflow sequences on the HP12C (need to be for CFA exams).

I have a 3rd edition HP12C (Chinese one 2 cells model HSTNJ-KN05 same as 30th anniv edition but that text isn't on the face purchased around 2010/11) and it runs on lengthy cashflows in well less than a second.

The program and other details are in the attached pdf. Let me know how you get on with it.

It's unlikely I will ever need such a calculation, and I'm 100% certain I'll never take the CFA exam, but I WILL enter it in a 12C to dabble, just because of the beautiful documentation; it's a lot like using an old school HP manual. I look forward to the stackrobatics too, always fun to explore.

Thanks for sharing this Joe!
Hi Joe, thanks for your hard work and for creating the payback period program. Could you please detail the steps of the example with the keystrokes sequence? ( sorry I am not getting the correct answer!)

Example - Simple payback so I =0

Initial investment 1000
Year 1 200
Year 2 300
Year 3 800
Year 4 200
Year 5 600

In this case, how do I enter the data in HP 12c?
I tried the following:
f-REG
-1000 g CFo
200 g CFj
300 g CFj
800 g CFj
200 g CFj
600 g CFj
0 i
5
R/s

I got answer 1.4 but that's not correct. Could you please advise me. i hope, for discounted payback, the only difference is with the value of i.

Thanks a lot for your efforts.
Hi Joe,
One clarification please on your program for calculating the payback period in HP 12 c

In step 37 you mentioned that {divided by key}, could you please details what should I type for this after pressing the divide sign.

sorry to bother you and asking basic questions.

thanks Joe.
RajMohan
rajmohanpr, sorry I don't recall exactly how to enter the cashflow. Remember that the Nj's get changed if more than 1 if you do a calculation and have to be reset to the correct value.

After the divide sign just follow the rest of the program as indicated.

Joe
rajmohanpr,

I programmed in the program exactly as in the attached sheet and entered your cashflow. For simple payback (i=0%) I got 2.625 which is correct. For i=10% I got 2.948... which looks about right.

Make sure you entered the program correctly. Just press the keys as in the programming guide and don't press enter between them. The guide shows what should be on the screen at each step.

To run a calculation enter the cashflow as per the HP12C guide (note positive and negative for investment and returns). As Nj is 1 in your cashflow at every step it is straightforward. n should now be 5 (check with RCL n). Enter 0 for i. Enter 5 on the screen (don't press enter) - this is the total number of cashflow steps (check guide for n versus N - same in your case). Now press R/S and 2.625 should appear on your screen. (Make sure n is set to 5 as it changes when program is run and set N on screen before pressing R/S.

Joe
rajmohanpr,

I see your confusion in the program. Ignore the text {divided by key} and just hit that top right key. I was trying to make sure people didn't mistake it for the + key.

Joe
rajmohanpr,

Also, I just recalled there are a few subtle differences between the different models of HP12C around stack popping after operations etc. It is possible that could be the issue. Please note my edition of HP12C in the first post in this thread. There are some posts on this around on this forum which should help (I have a few on HP12C v HP12C+). First, re-enter the program and make sure you set up the cashflow correctly. After that, see if it is a subtle calculator edition issue.

Joe
(06-10-2019 09:32 PM)Joe_H Wrote: [ -> ]For the CFA exams one of the reasons most commonly quoted for preferring the TI BA II is that the HP12C cannot do discounted payback calculations (or simple ones either).

What a lovely piece of work. Well done, Joe.

Like others, I will never sit the CFA exam because I'm an engineer and near the end of my career. But I can still appreciate a beautiful piece of work.

Best...
Reference URL's