+ Reply to Thread
Results 1 to 10 of 10

Xirr - Calculation with Criteria

  1. #1
    Registered User
    Join Date
    01-08-2015
    Location
    Sheffield, England
    MS-Off Ver
    2010
    Posts
    6

    Xirr - Calculation with Criteria

    Good Afternoon,

    I need to calculate the XIRR at specific points in time, but there are other criteria to consider. Please see the attached spreadsheet.

    The calculation needs to include: ALL Dates, ALL Drawdowns up to each Valuation point AND only the corresponding Valuation. I've highlighted the relevant cells Yellow for this example.

    I have included actual data and a working example. If you require further info, please let me know.
    Attached Files Attached Files
    Last edited by carlbrianhadi; 08-30-2018 at 05:31 AM.

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

    Re: Xirr - calculation required

    XIRR() does not tolerate non-numeric values in its input ranges very well, if at all, so I would usually solve this kind of problem by completely removing the undesired values from the input range. I think a lot will depend on how much automation is required.

    1) If this is a one time or rare task, I would probably do it manually exactly like you have done it here -- make a copy of the list and delete the appropriate rows.
    2) If I want a little bit more automation, I might set up an advanced filter (https://www.contextures.com/xladvfilter01.html ) that will filter the list for all drawdown entries before a specified date and the one valuation entry for that date, and have advanced filter copy the filtered list to another range. My XIRR() function is then set up to use the output ranges for the advanced filter. I would still need to manually call advanced filter for each set, but that should be minimal effort.
    3) If I decide that I am doing this frequently enough to justify the programming investment, then I work on either a VBA procedure or formulas that perform the same tasks as 2 without user input. It might look something like this solution I proposed to another user: https://www.excelforum.com/excel-for...uous-data.html

    How do you want to proceed?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

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

    Re: Xirr - calculation required

    Quote Originally Posted by MrShorty View Post
    XIRR() does not tolerate non-numeric values in its input ranges very well, if at all
    I don't see any "non-numeric" values in any of the relevant ranges. That is, ISTEXT returns FALSE for all of A4:A23, C4:C23, F4:F12 and H4:H12. It is possible that the OP corrected the Excel attachment after your posting.

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

    Re: Xirr - calculation required

    Quote Originally Posted by carlbrianhadi View Post
    I need to calculate the XIRR at specific points in time, but there are other criteria to consider.
    Please be more specific about what you mean by "specific points in time" and "other criteria".

    The Excel attachment shows relevant data in columns A and C and a subset of the data in columns F and H.

    Are we to infer that one of the criteria is a date range? If so, does that range always start with the initial date (C4)? Does the required data range always end with a "valuation"?

    Also, you describe the initial date as a "drawdown". Usually, that term means "a reduction of investment"; a withdrawal. But since the valuation is positive, I infer that the negative values are investments or deposits, not withdrawals. Correct? If so, does the initial investment (A4) include any pre-existing balance? Or are the valuations based solely on "drawdown" funds and earnings thereon?

  5. #5
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,613

    Re: Xirr - calculation required

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title go to your first post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Ben Van Johnson

  6. #6
    Registered User
    Join Date
    01-08-2015
    Location
    Sheffield, England
    MS-Off Ver
    2010
    Posts
    6

    Re: Xirr - calculation required

    My apologies. Thread title updated on original post.
    Last edited by carlbrianhadi; 08-30-2018 at 05:52 AM.

  7. #7
    Registered User
    Join Date
    01-08-2015
    Location
    Sheffield, England
    MS-Off Ver
    2010
    Posts
    6

    Re: Xirr - calculation required

    joeu2004 - to answer your questions.

    I need to calculate the XIRR at each Valuation point (point in time). The subset of the data, shows what I'm trying to achieve, but the solution needs to be applied to the full data set.

    In this case, yes, the date range should always start with C4. Each calculation should include ALL prior dates, up to and inclusive of the Valuation date. Yes the required data range should always end with a Valuation.

    The data set is correct in terms of positive and negative values.

    Thank you.

  8. #8
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Xirr - Calculation with Criteria

    Hi,

    Perhaps adding a few more manually calculated expected results to your workbook would be useful.

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

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

    Re: Xirr - calculation required

    @carlbrianhadi.... The following works by coincidence (explained below) with your example.

    Array-enter (press ctrl+shift+Enter instead of just Enter) the following formula into D4, then copy D4 and paste into D5:D23:

    Please Login or Register  to view this content.
    It works only for your example and only by coincidence because your example requires a "guess" parameter (-1%) in order to coerce XIRR to return a reasonable result. For some other examples, a "guess" of -1% might not work.

    Also, we use IFERROR to mask a #NUM error in D5. That #NUM error is reasonable since a mathematical calculation of the IRR is (0/126000)^35 - 1 = 0^35 - 1 = -100%. Apparently, Excel XIRR does not recognize the special case. And in general, the IRR cannot be -100%, since NPV = 126000/(1-100%)^0 + 0/(1-100%)^1 is not computable.

    But the use of IFERROR might mask other #NUM and #DIV/0 errors, which normally requires a (different) "guess" parameter to remedy the error, if that is even possible.

    It should also be noted that Excel XIRR sometimes returns bogus numerical results, which would go undetected. In particular, XIRR might return about +/-2.98E-09, which appears to be zero unless you format the cell as Scientific. In my experience, that particular result should be interpreted the same as #NUM or #DIV/0, namely: we should provide a (different) "guess" parameter.

    The best way to detect bogus numerical results is calculate the NPV and ensure that it is "relatively close to zero". That is purposely vague, to imply that the test is fraught with error. Moreover, Excel XNPV does not allow negative discount rates; a defect, IMHO. We would need to use a SUMPRODUCT expression to calculate the (X)NPV ourselves. Ostensibly, that formula would be (X1 = result of XIRR):

    =SUMPRODUCT(C4:C23/(1+X1)^((A4:A23-A4)/365))

    But of course, that needs to be embellished and array-entered in a manner similar to the XIRR formula above.
    Last edited by joeu2004; 08-31-2018 at 11:52 AM. Reason: minor improvements

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

    Re: Xirr - calculation required

    PS.... I should also mention:

    1. Sometimes, there is more than one IRR mathematically. Excel XIRR might not find the "best" one. Sometimes, it does not find all of them, even with good "guesses".

    2. Sometime, there is no IRR mathematically.

    3. My own Newton-Raphson implementation of XIRR often finds an IRR without any "guess" when Excel XIRR requires one. I suspect Excel XIRR approximates the derivative, whereas I calculate an exact derivative.

    4. There is no simple formula for determining a "guess". I look for zero crossing along an NPV curve for varying discount rates; that works well for "reasonable" IRRs. Alternatively, -10% often works well, even when the IRR should be positive. (But no guarantees.)

    I hope you are getting the impression that it is foolish to try to automate IRR calculations.

+ 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. [SOLVED] R1C1 Calculation - Syntax Help Required
    By Stroobs in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-16-2018, 09:11 AM
  2. Calculation required
    By Shanethompson in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-02-2015, 11:38 AM
  3. YTD Calculation Help Required
    By caashishddm in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 04-30-2014, 05:12 AM
  4. Blank cell if no calculation required
    By unsnz in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-12-2013, 08:57 PM
  5. Postcode distance Calculation (urgent help required)
    By stevennicholls in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-23-2013, 06:58 AM
  6. Help required to work out calculation... Please...
    By Snowmonster in forum Excel General
    Replies: 2
    Last Post: 10-02-2012, 05:11 AM
  7. [SOLVED] Help required to automate calculation
    By Tom in forum Excel General
    Replies: 1
    Last Post: 02-02-2005, 10:06 AM

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