Post Reply 
(Plus42) Cash Flow Analysis: NPV, IRR%, MIR%, FMR%
02-09-2022, 02:36 PM
Post: #12
RE: (Plus42) Cash Flow Analysis: NPV, IRR%, MIR%, FMR%
(02-09-2022 01:04 PM)Thomas Okken Wrote:  like putting something like L(COUNT:G(COUNT)+1) in the equation
Thought of that, too, so I did
Code:
NPVIRR:0*(
  L(N:MROWS(CF))+L(M:MCOLS(CF))+IRR%+NPV+
  L(P:0)+L(R:1+IRR%/100)+
  IF(G(M)=1:
      Σ(I:G(N):1:-1:L(P:(G(P)+CF[I])/G(R))):
      Σ(I:G(N):1:-1:L(Nj:CF[I:2])+L(P:G(P)*SPPV(IRR%:G(Nj))+CF[I:1]*USPV(IRR%:G(Nj))))
  )
)+
G(NPV)-G(P)*G(R)+0*L(D:D+1)
Initialize D to zero, and it will either show D=1 for direct solving, or D>1 for iterative calls.
And of course, NPV is also solved for iteratively, even if it is referenced only once. The equation can only be directly solved if NPV can be isolated, which is not the case here. When I remove the line at the beginning setting the order of the variables (+IRR%+NPV), and change the equation at the end to use NPV instead of G(NPV), it works. In this case it doesn't matter, but how then to both use direct solving and your preferred order of variables (eg in the much larger CFA equation, where only IRR% needs to be solved iteratively)? I will probably have to choose ;-)
Cheers, Werner

41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (Plus42) Cash Flow Analysis: NPV, IRR%, MIR%, FMR% - Werner - 02-09-2022 02:36 PM



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