Search code examples
c#algorithmmathworksheet-function

Different results for XIRR between Excel and ExcelFinancialFunctions 3.2.0


We have been investigating this issue for a long time and would appreciate your help.

XIRR is a deterministic function correct?

  1. How come when we are using Excel.FinancialFunctions.Financial.XIRR we receive 7.000000% but Excel for the same series of dates and values returns 6.9779%?

  2. When we change the last date from Dec 31st 2023 to Dec 30th 2023, it "fixes" it.

  3. This only happens in this specific case, not in other calculations we ran.

Excel XIRR result for these values:

  • First table shows the issue, we receive 6.9779% while .Net returns a precise 7%
  • The second table shows weirdly how changing the last date to Dec 30th "solves" the issue but that does not bridge the gap of the main question: Why do Excel and .Net return different result for the same values when calculating XIRR?

Excel XIRR result for these values

Excel XIRR result - after moving the last date one day backwards


Solution

  • The answer is:

    • Excel doesn't take time in account, dates only.
    • ExcelFinancialFunctions 3.2.0 does take time in account

    So then the difference between two dates returns different values and the final result is different.