Reputation: 41
I'm trying to create an XIRR
function that will adjust how many periods it is measuring based on the address of a specific value. For example, if the value occurs in month 48, I want the XIRR
function to measure 48 columns of data, but if the value occurs in month 17,
I want XIRR
to only measure 17 columns. I can get the address of the value and the corresponding dates using=CELL("address", MATCH(...
etc., but I can't figure out how / if I can concatenate the XIRR
inputs. Initially, I hoped I could do something like:
=XIRR(A1:Cell("address", [value_reference]), B1:Cell("Address", [date_reference]))
Can anyone help me with this? Using Excel 2007
Upvotes: 4
Views: 4282
Reputation: 55692
You can use OFFSET
to make a dynamic range
If for example
A1:A50
B1:B50
D2
(that occurs in your values in column A) Then this formula
=XIRR(OFFSET(A1,0,0,MATCH(D2,$A$1:$A$50,0),1),OFFSET($B$1,0,0,MATCH(D2,$A$1:$A$50,0),1))
will do the dynamic range matching
Upvotes: 2