Why does the XIRR function in the Financial Toolbox give different results than the Excel XIRR function?

7 views (last 30 days)
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
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.

More Answers (0)

Categories

Find more on Data Export to MATLAB in Help Center and File Exchange

Tags

No tags entered yet.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!