Why does the XIRR function in the Financial Toolbox give different results than the Excel XIRR function?
7 views (last 30 days)
Show older comments
The XIRR function in the Financial Toolbox gives different results than the Excel XIRR function.
For example:
The following code:
cf=[-10,6,6,5]
df=[datenum('1/31/2000'),datenum('6/1/2000'),datenum('12/1/2000'),datenum('6/1/2001')]
xirr(cf,df)
in MATLAB returns 1.033956 but in Excel returns 1.030014.
I increased the number of iterations in MATLAB, but I got the same results.
Accepted Answer
MathWorks Support Team
on 27 Jun 2009
This difference is due to the day count on the two pieces of software.
The Excel version of XIRR uses a day count basis of 365 days a year regardless of leap year.
The MATLAB version of XIRR uses the actual number of days in the year involved. In this case (the year 2000 or 2004), the MATLAB XIRR uses 366 instead of 365 because this is a leap year.
0 Comments
More Answers (0)
See Also
Categories
Find more on Data Export to MATLAB in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!