The Museum of HP Calculators

HP Articles Forum

[Return to the Index ]
[ Previous | Next ]

HP-35S Multiple cashflow / NPV / IRR / NFV / NUS program

Posted by Caspar L on 1 Aug 2008, 2:18 p.m.

Hello all,

Please find below my financial program for the HP-35s calculator for multiple cashflows / investment analysis.

- indirect registers are used for the multiple cashflows
- indirect registers are NOT cleared after end of program
- when run again previous values of the cashflows are recalled to stack level T
  (ready to be used again), the cashflow counter is shown on stack level X
- after entering each cashflow value press the [R/S] key to continue
- the number of cashflows is limited by memory only
- two labels are used because the solver is used with a program to calculate the IRR (label R program)
- obviously you can use different labels (instead of C and R)
- to continue after solution for P etc is shown just press [R/S] key

C001 LBL C C002 SF10 C003 INPUT N C004 1 C005 + C006 STO J C007 1 C008 STO (J) C009 INPUT I C010 STO R C011 0 C012 STO J C013 EQN CF0,CF1, ,CFN C014 PSE C015 RCL J C016 RCL (J) C017 STOP C018 STO (J) C019 1 C020 STO+ J C021 RCL J C022 RCL N C023 x<y? C024 GTO C027 C025 Rdown C026 GTO C015 C027 0 C028 STO P C029 0 C030 STO J C031 RCL (J) C032 1 C033 RCL I C034 100 C035 / C036 + C037 RCL J C038 ^ C039 / C040 STO+ P C041 RCL J C042 RCL N C043 x=y? C044 GTO C048 C045 1 C046 STO+ J C047 GTO C031 C048 VIEW P C049 0 C050 STO F C051 0 C052 STO J C053 RCL (J) C054 1 C055 RCL I C056 100 C057 / C058 + C059 RCL N C060 RCL J C061 - C062 ^ C063 * C064 STO+ F C065 RCL J C066 RCL N C067 x=y? C068 GTO C072 C069 1 C070 STO+ J C071 GTO C053 C072 VIEW F C073 CF 10 C074 EQN P/((1-(1/(1+I/100)^N))/(I/100)) C075 STO U C076 VIEW U C077 0 C078 STO Q C079 0 C080 STO J C081 FN= R C082 SOLVE R C083 VIEW R C084 RCL P C085 RCL F C086 RCL U C087 RCL R C088 RTN

R001 LBL R R002 RCL (J) R003 1 R004 RCL R R005 100 R006 / R007 + R008 RCL J R009 ^ R010 / R011 STO+ Q R012 RCL J R013 RCL N R014 x=y? R015 GTO R019 R016 1 R017 STO+ J R018 GTO R002 R019 RCL Q R020 0 R021 STO J R022 0 R023 STO Q R024 Rdown R025 Rdown R026 RTN

variables used: N = number of periods, excluding investment at t=0 I = interest or cost of capital in % J = loop counter for cashflows P = NPV F = NFV U = NUS R = IRR in % Q = temporary variable for solver

An example:

*INPUT* N=8 I=10 CF0=-130000 CF1=7000 CF2=-10000 CF3=20000 CF4=20000 CF5=20000 CF6=12000 CF7=-8000 CF8=178500

*OUTPUT* NPV=-4855.85 NFV=-10408.94 NUS=-910.20 IRR=9.37%

The output is available in the aforementioned registers and on the 4 stack levels. Note that NPV<0 (and IRR<I), thus the project is not worth undertaking.

Have fun with the program. In case of questions or suggestions, please send an e-mail.


Edited: 24 Aug 2008, 5:09 p.m.


[ Return to the Message Index ]

Go back to the main exhibit hall