Post Reply 
Problem with MVAR on HP42S
06-10-2020, 08:58 AM
Post: #5
RE: Problem with MVAR on HP42S
Hello,

Thanks for your answers.

All I wanted to do was a solver program to solve internal rate of return (IRR) of a cash flow set (including frequency for each cash flow).

I was rusty and this is how it ended up:

CF = Preexisting Cash flow matrix (amount in column 1, frequency in column 2, CF(1,1) < 0)
Use Solver with NPV to find IRR (Enter guess for interest rate "IR" (e.g. use 0.1 for 10%))
XEQ NPV alone calculates Net Present Value for the CF cash flow set (with "IR" value)

R03: Intermediary future value
R04: Intermediary total number of cash flows
R05: Current cash flow amount
R06: Current cash flow frequency

Code:

00 { 70-Byte Prgm }
01 LBL "NPV"
02 MVAR "IR"
03 INDEX "CF"
04 0
05 STO 03
06 STO 04
07 LBL 00
08 RCLEL
09 STO 05
10 J+
11 RCLEL
12 STO 06
13 STO+ 04
14 LBL 01
15 1
16 RCL+ "IR"
17 RCL× 03
18 RCL+ 05
19 STO 03
20 DSE 06
21 GTO 01
22 J+
23 FC? 77
24 GTO 00
25 1
26 RCL+ "IR"
27 1
28 RCL- 04
29 Y↑X
30 RCL× 03
31 RTN
32 END

Thanks !
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Problem with MVAR on HP42S - Pekis - 06-07-2020, 08:09 PM
RE: Problem with MVAR on HP42S - grsbanks - 06-07-2020, 08:41 PM
RE: Problem with MVAR on HP42S - GreyUser - 06-09-2020, 01:24 AM
RE: Problem with MVAR on HP42S - Pekis - 06-10-2020 08:58 AM
RE: Problem with MVAR on HP42S - Werner - 06-12-2020, 08:59 AM



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