+ Reply to Thread
Results 1 to 6 of 6

flexible XIRR with different starting dates

  1. #1
    Registered User
    Join Date
    10-11-2019
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    3

    flexible XIRR with different starting dates

    Hello all, I am looking for a flexible IRR that looks up dates and cash flows when each cash flow (one set of cash flows per line with dates all located on the top line.
    If I use simple IRR I cannot copy it down as then there are zero cash flows before the first negative cash flow so I need a flexible IRR that can basically either look up a start date and then XIRR all cash flows or a flexible IRR that will ignore the zeros and start at the first negative cash flow. My excel looks like this below. Any responses appreciated!

    excel.JPG
    Last edited by mrp2018; 10-11-2019 at 09:32 AM.

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

    Re: flexible XIRR with different starting dates

    In this forum, you can attach an Excel file, which is always better than an image. Please see my Excel file attachment. I think I faithfully reproduced your data as well as my formulas.

    Also, in this case, it would be prudent to show the calculations that you want manually. I believe you want the XIRR from the first non-zero cash flow to the last non-zero cash flow for each row. See my formulas in F8:F10, which I call "XIRR min range". They are:

    Model 1: =XIRR(H2:T2, H1:T1)
    Model 2: =XIRR(J3:U3, J1:U1)
    Model 3: =XIRR(J4:Q4, J1:Q1)

    Please confirm my assumptions. Based on those assumptions....

    -----

    Since your cash flows are monthly, I believe it would be easier and possibly more correct to use the Excel IRR function.

    Unlike Excel XIRR, Excel IRR has no problem with initial zero cash flows, as well as zero cash flows at the end.

    For consistency with Excel XIRR, the annualized monthly IRRs are calculated D8:D10, which I call "IRR D:U range". They are:

    Model 1: =(1+IRR(D2:U2))^12 - 1
    Model 2: =(1+IRR(D3:U3))^12 - 1
    Model 3: =(1+IRR(D4:U4))^12 - 1

    You might be concerned that the IRRs are calculated to the wrong "present value" date because we always start with column D. Mathematically, we can explain why it does not matter. But more simply, I calculate the "IRR min range" values in C8:C10, to wit:

    Model 1: =(1+IRR(H2:T2))^12 - 1
    Model 2: =(1+IRR(J3:U3))^12 - 1
    Model 3: =(1+IRR(J4:Q4))^12 - 1

    They all compare equal, as demontrated by the TRUE results in E8:E10.

    You will note that there is (and always will be) a small difference between the annualized monthly IRR and the XIRR results. This is because Excel XIRR uses the exact numbers of days between cash flows, and it compounds daily; whereas, Excel IRR assumes equal days between cash flows, and the annualized calculation compounds monthly.

    -----

    If you prefer to use Excel XIRR, I demonstrate the calculation of what I call "flex XIRR" in C2:C4. The formulas are:

    Model 1: =XIRR(INDEX(D2:U2,B8):U2, INDEX($D$1:$U$1,B8):$U$1)
    Model 2: =XIRR(INDEX(D3:U3,B9):U3, INDEX($D$1:$U$1,B9):$U$1)
    Model 3: =XIRR(INDEX(D4:U4,B10):U4, INDEX($D$1:$U$1,B10):$U$1)

    For simplicity and efficiency, those formulas depend on calculating the relative column number of the first non-zero cash flow for each model in B8:B10. The formulas are:

    Model 1: =MATCH(TRUE, INDEX(D2:U2<>0,0), 0)
    Model 2: =MATCH(TRUE, INDEX(D3:U3<>0,0), 0)
    Model 3: =MATCH(TRUE, INDEX(D4:U4<>0,0), 0)

    The INDEX expression is a "trick" to avoid array-entering the MATCH formula. That is, the MATCH formula is normally-entered: just press Enter as usual.

    If you prefer not to rely on such "helper cells", you can replace both instances of B8 in the "flex XIRR" with the corresponding MATCH expression. Do the same with B9 and B10, of course.

    For simplicity, the "flex XIRR" formulas extend to column U, including possible zero cash flows and corresponding dates at the end. The comparisons in G8:G10 demonstrate that the result is the same as the "XIRR min range".
    Attached Files Attached Files
    Last edited by joeu2004; 10-12-2019 at 12:41 AM. Reason: minor improvements; corrected "IRR min range"

  3. #3
    Registered User
    Join Date
    10-11-2019
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    3

    Re: flexible XIRR with different starting dates

    Thank you!! I will ensure to post an excel sheet next time.
    Your assumptions were correct. Only, I did not want to use IRR, as I may need to change the dates on the top row to not month end ones, which would then result in inability to use IRR.

    The XIRR with the column index does exactly the job in a very simple and flexible way, so thanks again!

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

    Re: flexible XIRR with different starting dates

    Quote Originally Posted by mrp2018 View Post
    I did not want to use IRR, as I may need to change the dates on the top row to not month end ones [....] The XIRR with the column index does exactly the job in a very simple and flexible way, so thanks again!
    You're welcome.

    I just want to point out that the use of Excel IRR only requires that cash flows occur "monthly" (in your example), not necessarily at the end of the month.

    "Monthly" is purposefully vague. Examples: first of the month; end of the month; 15th of each month; etc.

    I would use the monthly IRR when interest or investment rate of return (e.g. bond coupon) is paid "monthly" and calculated by annual rate divided by 12 instead of annual rate divided by 365 (or 366) times days between payments.

    (In fact, for compatibility with Excel XIRR, the daily rate would be (1 + annual rate)^(1/365) - 1. The corresponding "monthly" rate would be (1 + annual rate)^(1/12) - 1. But we don't need to know that that in order to use Excel XIRR, since it returns the annual rate.)

    Just FYI, so that you can make an informed decision. Forgive me this is "old news" for you.

  5. #5
    Registered User
    Join Date
    10-11-2019
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    3

    Re: flexible XIRR with different starting dates

    thanks again. Yes, I may need to change the dates to non monthly cash flows, hence needed XIRR. I appreciate the detailed answer

  6. #6
    Registered User
    Join Date
    11-25-2019
    Location
    Bucharest
    MS-Off Ver
    2016
    Posts
    1

    Re: flexible XIRR with different starting dates

    Beautiful, needed that as well. Thank you! Pretty elegant solution, too!

+ 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: 4
    Last Post: 08-12-2018, 04:58 AM
  2. [SOLVED] How to match values among columns with different starting dates
    By jrtaylor in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 07-16-2018, 06:51 PM
  3. Need a formula with flexible start and end dates from a range
    By Lax97 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-18-2017, 12:23 PM
  4. Transposing dates starting from a specific date?
    By Hallaluya in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-29-2016, 11:32 AM
  5. XIRR and Dates
    By Liebschki in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-07-2015, 03:13 AM
  6. Index with different starting dates
    By ygd in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-26-2013, 05:35 AM
  7. Need formula help with automatic monthly column coloring based on flexible dates
    By excellearning in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-25-2013, 04:27 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