+ Reply to Thread
Results 1 to 12 of 12

collate cash flow series by dates

  1. #1
    Registered User
    Join Date
    05-19-2010
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2003
    Posts
    5

    collate cash flow series by dates

    I have 3 large series of cash flows, each with its own unique set of correlating dates. I am trying to figure out a way to collate or merge the cash flow series' in order to calculate the return using the XIRR formula. If the cash flow series were small enough, I could stack them, since the XIRR formula doesn’t require cash flows be in order, or cut/paste and data sort. However I am looking for an elegant solution that ideally can collate the three cash flow series with dates into one cash flow series with dates (without requiring manual cutting/pasting/sorting), or some way to apply the XIRR function simultaneously to all three cash flows.

    I have attached sample cash flow series in problem form and how I'd like the solution to look.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    05-16-2010
    Location
    UK
    MS-Off Ver
    2003 and 2007
    Posts
    252

    Re: collate cash flow series by dates

    Would the attached work for you? I've written a UDF MRANGE that combines 3 ranges that you input. You can then use it as:

    =XIRR(MRANGE(range1,range2,range3),MRANGE(range1,range2,range3))

    It gives the same result as you have in your example for the combined data.
    Attached Files Attached Files
    Last edited by pb71; 05-21-2010 at 05:00 PM.

  3. #3
    Forum Contributor
    Join Date
    05-16-2010
    Location
    UK
    MS-Off Ver
    2003 and 2007
    Posts
    252

    Re: collate cash flow series by dates

    I've updated the function to allow for optional ranges (Range2 and Range3) and reattached the workbook in the previous post.
    Last edited by pb71; 05-21-2010 at 05:03 PM.

  4. #4
    Registered User
    Join Date
    05-19-2010
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: collate cash flow series by dates

    Brilliant! Great solution pb71! Much appreciated.

  5. #5
    Forum Contributor
    Join Date
    05-16-2010
    Location
    UK
    MS-Off Ver
    2003 and 2007
    Posts
    252

    Re: collate cash flow series by dates

    You're welcome.

    Just noticed that you use Excel 2003. Guess you had the compatibilty pack.

  6. #6
    Registered User
    Join Date
    05-19-2010
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: collate cash flow series by dates

    pb71 -

    I may have spoken too soon. Since I was able to use the formula in the worksheet you sent, I didn't realize that the MRANGE function was user defined (I must have glazed over UDF- lol). I am now trying to recreate that function in a different workbook. I don't seem to be able to see how you coded this UDF. Any way you can send the VBA code?

    Thanks again.

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: collate cash flow series by dates

    It's in the posted workbook in Module1.
    Entia non sunt multiplicanda sine necessitate

  8. #8
    Registered User
    Join Date
    05-19-2010
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: collate cash flow series by dates

    pb71 -

    Cancel that - I figured out how to extract the VBA code myself.

    One follow up question that may be more interesting to answer - is it possible to make the MRANGE formula agnositic to the data being arrayed vertically or horizontally? Currently, the UDF appears to work for vertically arrayed data, but the results are off if the data is arrayed horizontally. I have data sets arrayed both ways that I'd love use simultaneously in one XIRR function. Any ideas?

    I've uploaded a worksheet to demonstrate.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    05-19-2010
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: collate cash flow series by dates

    There also appear to be limitations to the MRANGE formula on the size of data ranges it can handle. It will work fine for me on relatively small ranges used for demonstration purposes, but when I apply it to large data ranges with 1500+ cells, the XIRR function using nested MRANGE functions appears to not function well, returning #VALUE!.

    ideas?

  10. #10
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: collate cash flow series by dates

    Look at the values for 1/1/2011 and 1/1/2012. They're not the same in all series.

  11. #11
    Forum Contributor
    Join Date
    05-16-2010
    Location
    UK
    MS-Off Ver
    2003 and 2007
    Posts
    252

    Re: collate cash flow series by dates

    team_qq,

    As shg pointed out, your XIRR figures would be different in the MRANGE Explain workbook you posted because the values in your horizontal and vertical ranges are different. Your example workbook did not have the MRANGE UDF in it, so I have copied the UDF to Module1 in the attached workbook, and using the example you posted, I have corrected the values in the horizontal and vertical ranges so that they are consistent, and the function works for vertical, horizontal and combined vertical and horizontal ranges.

    When you say you get a #VALUE! error using the XIRR function with nested MRANGE functions for large ranges of data (1500+ rows), have you tried using just the XIRR function on the same data (having rearranged the separate ranges of values and dates into single ranges of values and dates first, like you did originally)? If you have tried this already, could you post an example workbook?
    Attached Files Attached Files
    Last edited by pb71; 05-29-2010 at 07:55 PM. Reason: Additional comment

  12. #12
    Forum Contributor
    Join Date
    05-16-2010
    Location
    UK
    MS-Off Ver
    2003 and 2007
    Posts
    252

    Re: collate cash flow series by dates

    I have tested XIRR with nested MRANGE functions on 3000+ rows of data (see attached workbook) and I do not get an error. MRANGE will error if you only use a single range of data and if this is the case you would not need to use MRANGE.
    Attached Files Attached Files
    Last edited by pb71; 05-29-2010 at 08:03 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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