Possible XIRR bug

Topics: Developer Forum, User Forum
Dec 4, 2011 at 8:10 PM

Last week I installed a subset of PHPExcel into a php web-app, just the calculation functions, and it is working beautifully. For now I'm just using XIRR and FV. There is one case where XIRR is returning #value.

The dates array is (the second column is just for your reference, not sent to the function):

38644    10/20/09
38737    1/21/10
38756    2/9/10
38927    7/30/10
39051    12/1/10
39051    12/1/10
39064    12/14/10
39275    7/13/11
39403    11/18/11
39407    11/22/11
39419    12/4/11
39419    12/4/11
39419    12/4/11

and the amounts array is

-4871.58
5448.51
-5531.53
-6240.87
6668.51
-5711.53
-5391.52
1548.51
-491.52
-522.28
850
1500
822

This should produce a result of xirr= -0.68954860440939

When I add a guess of -.6 I get the absurd result xirr= -3.92382649159E+52

With a guess of -0.689549 I get the right result. Any guess with fewer digits fails.

$xirr = $math->XIRR($values, $dates, -0.689549); works.

Is this a bug or just a quirk of the XIRR function?

 

Denny Schlesinger