+ Reply to Thread
Results 1 to 2 of 2

XIRR with Variable Ranges and Non Contiguous Data

  1. #1
    Registered User
    Join Date
    05-17-2012
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    1

    XIRR with Variable Ranges and Non Contiguous Data

    I'm Googling in circles today trying to figure out a solution to the attached. In column H, I am trying to calculate the IRR (using XIRR) if the Future Inflow (B3) were to be received on the date for each row. I can run the XIRR using offsets, but it doesn't bring in the final future inflow because it is not inline with the other cashflows and dates. The "Years" column (column G) is servicing as a reference for the offset formulas I've been toying with. The example formula in H9 is missing the necessary inflow from B3. In my mind, I am trying to create a formula that does the following: =XIRR((OFFSET($F$8,0,0,G9,1)~AND THE ONE VALUE THAT IS LOCATED IN B3~),OFFSET($E$8,0,0,G9,1)~AND THE ONE DATE THAT IS LOCATED IN THIS SAME ROW~,0.1). Any help is greatly appreciated.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,373

    Re: XIRR with Variable Ranges and Non Contiguous Data

    Perhaps it is just my biases (towards using helper ranges), but I have always felt that the easiest solution to this kind of problem is to get the needed data into a contiguous range. So, here's how I approached this problem:

    1) Select G8:G38-> Ctrl-C to copy to clipboard -> Select I7 -> Paste Special -> Transpose to make a horizontal copy of the years.
    2) In I8, I enter =$F8 (note the mixed reference so the column is fixed when copying).
    3) In I9, I enter =IF($G9>I$7,IF($G9=I$7+1,$B$3,"no"),$G9). Copy I9 down to I38
    4) Select I8:I38 -> copy -> paste into J8:AL8
    5) Enter an XIRR() function with OFFSET() functions for the input ranges into I5. =XIRR(OFFSET(I$8,0,0,COUNT(I$8:I$38),1),OFFSET($E$8,0,0,COUNT(I$8:I$38),1)). Copy I5 across to AL5.
    6) I notice that the later years return a value very near 0 -- indicating that the XIRR() function's internal algorithm failed to converge. In Excel, I can fix this by adding an optional guess (maybe -0.4) to the XIRR() function. I also observe that other spreadsheets (I tested in LibreOffice) have a more robust algorithm behind the XIRR() function and do not need a guess for those years. Just be aware of this possibility.

    That's how I (one who is somewhat fond of using helper cells and ranges) would do it.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

+ 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. XIRR for non contiguous arrays
    By Alexander_Golinsky in forum Excel General
    Replies: 3
    Last Post: 07-13-2012, 05:15 AM
  2. [SOLVED] XIRR for non contiguous arrays
    By Alexander_Golinsky in forum Excel General
    Replies: 1
    Last Post: 07-12-2012, 12:06 PM
  3. XIRR & non-Contiguous Values?
    By bluepost22@yahoo.com in forum Excel General
    Replies: 11
    Last Post: 06-24-2010, 03:11 AM
  4. Copy and Paste an array (contiguous & non contiguous ranges)
    By Xrull in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-09-2010, 09:17 AM
  5. Charting Non-Contiguous Data Ranges
    By Aakanaar in forum Excel General
    Replies: 5
    Last Post: 02-10-2009, 03:58 PM
  6. Gathering data from multiple, non-contiguous ranges
    By Codpops in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-23-2008, 07:25 PM
  7. [SOLVED] XIRR and Non Contiguous Cells
    By John Taylor in forum Excel General
    Replies: 3
    Last Post: 08-01-2006, 07:50 PM
  8. [SOLVED] XIRR non contiguous references
    By tloano in forum Excel General
    Replies: 2
    Last Post: 05-07-2006, 12:40 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