HP Forums
Cash Flow Analysis for the HP 35s - 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: Cash Flow Analysis for the HP 35s (/thread-123237.html)



Cash Flow Analysis for the HP 35s - Miguel Toro - 08-26-2007

This has been a great learning experience. With this program you can make Net Present Value and internal rate of return analysis and it is very simple to use. I made a lot of learning of how the HP 35s solver works and I'll talk about that in an article I am preparing for Datafile. Of course I was able to develop it thanks to these two great features of the calculator: vectors and indirect addressing. The program is based on the NPV formula found in the "HP 15c advance functions handbook".

IRR analysis takes a little time but I think is quite acceptable. With this one and the TVM already published, we have already a little financial pack for our HP 35s. :-)

Please test it and give me your comments.

Regards,

Miguel

Comments:

XEQ C -> enter CASH FLOWS
XEQ C024 -> Calculate NPV
XEQ C030 -> Calculate IRR
XEQ R052 -> Change values of a cash flow already entered
XEQ R068 -> Review the cash flows already entered. The routine is circular.

R001 -> IRR routine
R042 -> convert content of x,y stack registers into a vector [y,x]
R049 -> extract content of a vector [y,x] into registers x,y

- To finish entering cash flows enter 0 and them R/S.
- Interest is always by period, so if for exemple, you have monthly cash flows
and a annual interest rate, divide this by 12 to enter the monthly rate.
- You can enter any number of cash flow: the limit is the memory available.
- You can change or correct any of the cash flows entered with routine R052.
- To enter a cash flow: write the amount, press ENTER, write the number of occurences and press R/S.

Program:

C001 LBL C
C002 SF 10
C003 (EQN) AMOUNT,OCCUR
C004 PSE
C005 CF 10
C006 STO J
C007 R/S
C008 x=0?
C009 GTO C015
C010 XEQ R042
C011 STO(J)
C012 1
C013 RCL+ J
C014 GTO C006
C015 RCL J
C016 x>0?
C017 GTO C020
C018 CLSTK
C019 RTN
C020 1
C021 -
C022 STO T
C023 RTN
C024 INPUT I
C025 100
C026 /
C027 STO B
C028 XEQ R001
C029 RTN
C030 0
C031 STO N
C032 1E-3
C033 STO B
C034 FN= R
C035 SOLVE B
C036 GTO C038
C037 GTO C043
C038 100
C039 *
C040 STO I
C041 VIEW I
C042 RTN
C043 SF 10
C044 (EQN) NO SOLUTION
C045 CF 10
C046 RTN

LN= 174

R001 LBL R
R002 RCL B
R003 1
R004 STO D
R005 +
R006 STO C
R007 0
R008 STO E
R009 STO J
R010 RCL T
R011 x<y?
R012 GTO R039
R013 RCL(J)
R014 XEQ R049
R015 RCL B
R016 x=0?
R017 GTO R030
R018 1
R019 +
R020 x<>y
R021 +/-
R022 y^x
R023 STO D
R024 1
R025 x<>y
R026 -
R027 RCL/ B
R028 RCL* C
R029 GTO R031
R030 RDN
R031 *
R032 STO+ E
R033 RCL D
R034 STO* C
R035 1
RO36 STO+ J
R037 RCL J
R038 GTO R010
RO39 RCL E
R040 RCL-N
RO41 RTN
R042 [0,1]
R043 *
R044 x<>Y
RO45 [1,0]
R046 *
R047 +
RO48 RTN
R049 [1,0]
R050 x<>y
R051 *
R052 [0,1]
R053 LASTx
R054 *
R055 RTN
R056 SF 10
R057 (EQN) FLOW
R058 PSE
R059 R/S
R060 STO J
R061 (EQN) AMOUNT,OCCUR
R062 PSE
R063 R/S
R064 XEQ R042
R065 STO(J)
R066 CF 10
R067 RTN
R068 1E-3
R069 RCL* T
R070 STO J
R071 CLSTK
R072 RCL J
R073 IP
RO74 PSE
R075 RCL (J)
R076 XEQ R049
R077 R/S
R078 ISG J
R079 GTO R071
R080 GTO R068

LN= 285


Edited: 27 Aug 2007, 12:27 p.m.