+ Reply to Thread
Results 1 to 4 of 4

XIRR formula not working when adding extra cash flows

  1. #1
    Registered User
    Join Date
    10-01-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    6

    XIRR formula not working when adding extra cash flows

    I have the following cash flows and dates which I can calculate using the XIRR formula to get to -2.87%.

    However, if I add a cash flow of -0.1 on 01/01/2017 to the list of cash flows, the XIRR formula comes up as 0.00%.

    Does anyone have any idea why? Many thanks!

    19/01/2017 -3,750,000.00
    16/05/2017 -651,446.06
    21/08/2017 -172,049.45
    11/09/2017 -2,497.85
    21/09/2017 -800,000.69
    21/09/2017 -400,000.35
    25/10/2017 -1,200,000.00
    13/11/2017 -2,321.29
    19/12/2017 -745,920.00
    25/01/2018 -330,432.74
    01/02/2018 -87,454.09
    08/02/2018 -663,891.43
    09/02/2018 -8,330.46
    16/03/2018 -1,548,102.48
    29/03/2018 9,563.09
    04/05/2018 -500,000.00
    21/05/2018 -2,236.89
    23/05/2018 -100,000.00
    23/05/2018 -3,331,236.22
    22/06/2018 -3,000,000.00
    28/06/2018 9,563.09
    29/06/2018 -1,800,000.00
    30/06/2018 18,795,471.68

  2. #2
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: XIRR formula not working when adding extra cash flows

    First, "add a cash flow" where? I assume you put it before the 19/01/2017 line.

    (It would be wrong to put it anywhere else, since Excel XIRR uses the first date in the list as "day zero". It must be the earliest date.)

    Second, in that case, XIRR returns about 2.98E-09, not really 0.00%. In my experience, +/-2.98E-09 is another error state, like #NUM and #DIV/0, that indicates that XIRR cannot find a valid IRR (a discount rate that causes NPV to be nearly zero) within the internal limits of its algorithm. See the XIRR help page for details.

    Based on that assumption, providing a "guess" parameter sometimes helps. After looking at the NPV curve for varying discount rates from -99% to 100%, it seems that -2.5% might be a good guess.

    And indeed, =XIRR(B1:B24,A1:A24,-2.5%) in C3 provides a reasonable result, namely -2.86630576859789%. And note that the NPV with that discount rate is nearly zero, namely 3.72529029846191E-09.

    Caveat: We cannot use =XNPV(C3,B1:B24,A1:A24) to calculate the NPV due to a defect in Excel. The following calculates the NPV:
    =SUMPRODUCT($B$1:$B$24/(1+C3)^(($A$1:$A$24-$A$1)/365)) .

    As for why a "guess" is required one time, but not another, even though the calculated IRRs are similar: who knows why! Mathematically, the algorithm for calculating the IRR is unstable and unpredictable, especially when there are many sign changes and such a large difference in the magnitude of the cash flow values. The Excel XIRR implementation is even more unstable. I believe it is because (I assume) the internal algorithm approximates the derivative instead of using the exact derivative, which is computable.
    Last edited by joeu2004; 07-25-2018 at 06:46 PM. Reason: minor improvements

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,843

    Re: XIRR formula not working when adding extra cash flows

    Are you required to use Excel, or are you allowed to use a different spreadsheet? I have often found, as joeu2004 says, that Excel's internal XIRR algorithm seems less stable than the algorithms used in other spreadsheets. For example, I often find that simply opening a spreadsheet like this in LibreOffice calc or in Google sheets allows their seemingly more stable algorithm to calculate correctly without further changes. If that is an option...
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  4. #4
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: XIRR formula not working when adding extra cash flows

    Quote Originally Posted by MrShorty View Post
    I often find that simply opening a spreadsheet like this in LibreOffice calc or in Google sheets allows their seemingly more stable algorithm to calculate correctly without further changes.
    And in this case, my own "XIRR" implementation in VBA calculates an IRR that causes the NPV to be exactly zero without a "guess".

    I use a Newton-Raphson algorithm, but I calculate the exact derivative.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 5
    Last Post: 07-09-2017, 03:24 AM
  2. [SOLVED] uncertain cash-flows timing. create monthly cash report
    By excobra in forum Excel General
    Replies: 3
    Last Post: 05-14-2014, 11:10 AM
  3. NPV Formula Using Uneven, Monthly Cash Flows
    By DanoT in forum Excel General
    Replies: 1
    Last Post: 02-20-2012, 05:02 PM
  4. formula accounting for cash flows.
    By Gaunta in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-13-2011, 06:54 PM
  5. Waterfall Cash Model, dividing up cash flows based on IRR
    By tomservo2009 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 11-21-2008, 05:57 PM
  6. XIRR: Different cash flows but same answer. Why?
    By Guy Hoffman in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-24-2007, 11:37 AM
  7. IRR formula for monthly cash flows
    By MB Burgis in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-11-2006, 11:10 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1