(15C) Simple? NPV, XNPV, IRR & XIRR
|
05-09-2017, 08:22 PM
(This post was last modified: 05-10-2017 09:25 PM by Vtile.)
Post: #1
|
|||
|
|||
(15C) Simple? NPV, XNPV, IRR & XIRR
This program relates to:
(15C) Simple NPV (15C) MM.DDYYYY or DD.MMYYYY to Julian Day [Stack-Only] Not used, but will ease up using XIRR & XNPV features. The idea using solver for a IRR were copied from the The Calculator Store page, which SlideRule provided in Simple NPV thread. I weren't too impressed of the nine periods limitation (I do have DM15 with ~210 registers vs. ~65 in original 15C) so I'm not as limited, put this my smallish program should still work on original 15C (although barely) with combination of some other financial and date tools. My almost simple NPV, XNPV, IRR & XIRR program is capable of calculate those mentioned with up to 32 periods (if your device have memory). Registers in use: R0 - internal, matrix R1 - internal, matrix R2 - internal R3 - internal Matrix: A: 1 to 32 periods. Labels: 2 Lines: 33 Provided as is, use at your own risk for anything that matters. The program might have a few unnecessary lines here and there, but my experience on RPN is too limited to get every unnecessary lines of code out. Code:
How to use: I use program label XYZ for above simple program in this chapter. Let say you have four periods and initial investment. (example copied from ISBN:951-37-4788-3) 1.1.2000: $-78696.25 1.7.2000: $1420 1.7.2001: $2130 1.7.2002: $1775 1.7.2003: $2662.50 1.1.2004: 99652.81 First you need to declare a matrix, 5 Enter (ROWS IN Y REGISTER) 2 f DIM A Now you have matrix with 5 rows and 2 colums. Reset matrix counters (Registers 0 and 1) for just in case, f MATRIX 1 Press f USER Type in (yyy/365 are delta days from 1.1.2000): 0 STO A -78696.25 STO A 182/365 STO A 1420 STO A 547/365 STO A 2130 STO A 912/365 STO A 1775 STO A 1277/365 STO A 2662.50 STO A At this point Oops, you just noticed that your matrix isn't properly dimensioned... Lets type, [b]6 ENTER 2 DIM A 5 STO 0 2 STO 1 RCL A RCL A 1461/365 STO A 99625.81 STO A[/b] (IF you do make mistake, note that matrix for this program must have period exponent in column 1 (R1=1) and money in column 2 (R1=2) look the explanation of matrix operations from the manual if not sure. You can use STO 1, STO 2 and RCL 1, RCL0 or RCL A for error checking if needed.) f USER Now program XYZ needs a percentage in the X register so lets give it a 9% and run it to find XNPV. 9 ENTER GSB XYZ Result: $1502.6570 We definedly need to know XIRR.. 2 Enter f SOLVE XYZ (some times later..) Result: 8.4542% ... Enjoy EDIT. TVMs to NPVs |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)