Click to See Complete Forum and Search --> : IRR Calculation
j237fl
12-03-2002, 07:50 AM
I am having difficulty calculating IRR in Javascript. I have a working version in excel but, I cant seem to get a working Javascript version. If anybody could help point me in the right direction, it would be much appreciated.
Thanks in advance,
j237fl@hotmail.com
jalarie
12-03-2002, 01:54 PM
Calculating and Javascript I know; IRR I don't. If you can define IRR, I'll give it a try.
j237fl
12-04-2002, 06:34 AM
A= 1000
S=510
Solve formula by iteration for s
A = S/(1+s)^0+S/(1+s)^1
I'm not very good with algebra. The problem above is from an example with an answer.
Answer = .0408163
I just can't for some reason get that answer. So, if anyone out there is any good at algebra and could give some pointers, that would be much appreciated.
Thank you,
j237fl@hotmail.com
jalarie
12-04-2002, 07:21 AM
Anything to the zero power (^0) is just 1, and anything to the first power (^1) is that same thing, so your equation reduces to:
A = S + S/(1+s)
Subtract 'S' from both sides to give:
A - S = S/(1+s)
Divide by 'S' and get:
(A-S)/S = 1/(1+s)
Take the reciprocal:
S/(A-S) = 1+s
Subtract '1' from both sides:
S/(A-S)-1 = s
j237fl
12-05-2002, 06:19 AM
Thank you very much jalarie! It works perfectly, I was missing the step 'reciprocol'.