+ Reply to Thread
Results 1 to 4 of 4

XIRR with Dynamic Ranges

  1. #1
    Registered User
    Join Date
    08-03-2011
    Location
    Ontario
    MS-Off Ver
    Excel 2010
    Posts
    8

    XIRR with Dynamic Ranges

    I have managed to hack my way most of my issues myself but I have two outstanding issues that I’m posting under separate threads which deal with the same spreadsheet.

    This issue deals with using XIRR in dynamic ranges. For each investment in my sample spreadsheet I have quarterly investment cash flows in rows K to AM, however the initial cash flow does not always occur in the first column, K. The problem is that whenever the first value in the XIRR function begins with a zero cash flow, XIRR returns either 0% or -100%. So I need a formula to begin the XIRR calculation on the first column with a cash flow. The argument to the XIRR function has to be dynamic as I cannot predict which quarter the cash flow will begin for each investment (other than one investment will not be any earlier than a previous investment).

    Any ideas?
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor gjlindn's Avatar
    Join Date
    08-01-2011
    Location
    Dodgeville, WI
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    369

    Smile Re: XIRR with Dynamic Ranges

    Maybe I'm just getting too tired, but I couldn't come up with a way to do what you're looking for without a UDF. In conjunction with a new function FIRSTNONZERO and the INDIRECT function, I think I have it doing what you're looking for. The file had to be saved as xlsm, though, in order to allow the UDF.
    Attached Files Attached Files
    -Greg If this is helpful, pls click Star icon in lower left corner

  3. #3
    Registered User
    Join Date
    08-03-2011
    Location
    Ontario
    MS-Off Ver
    Excel 2010
    Posts
    8

    SOLVED: XIRR with Dynamic Ranges

    Quote Originally Posted by gjlindn View Post
    Maybe I'm just getting too tired, but I couldn't come up with a way to do what you're looking for without a UDF. In conjunction with a new function FIRSTNONZERO and the INDIRECT function, I think I have it doing what you're looking for. The file had to be saved as xlsm, though, in order to allow the UDF.
    Thanks. I didn't see your response so this morning I tinkered with it and figured that I needed to use OFFSET to create the ranges I needed as arguments for my XIRR function.

    =IFERROR(XIRR(OFFSET($K$38,ROW()-38,MATCH($D39,$I$3:$I$31,0)-1,1,F39+1),OFFSET(K$37,0,MATCH($D39,$I$3:$I$31,0)-1,1,F39+1)),-1)

  4. #4
    Valued Forum Contributor gjlindn's Avatar
    Join Date
    08-01-2011
    Location
    Dodgeville, WI
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    369

    Re: XIRR with Dynamic Ranges

    Nice job! Always feels better when you have that eureka moment for your own project I'd also thought about using match and offset, but I didn't make the link between column D and the headers in row 38. I couldn't make match work because i was trying to match to the lowest number not 0 and they have to be in order of least to greatest to do that. Anyway...glad you found a fix that doesn't need a UDF

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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