Can XIRR Work on Dates That Move Backwards in Time?
"W" wrote:
Today I worked with a spreadsheet where the dates move opposite:
Earliest date is on the far right, and more recent dates move
toward the left. Is there any way to get XIRR to work with such
an arrangement of dates? I only get errors.
It would be nice if XIRR sorted all of the dates and corresponding values.
(I created a user-defined function to do just that.)
But it does not.
The first date/value in the range must be the earliest date. All others can
be in any order.
Suppose your dates are newest-to-oldest in B1:Z1, with corresponding values
in B2:Z2.
Create the following array-entered formulas (press ctrl+shift+Enter instead
of just Enter):
A1: =Z1
A2: =Z2
Then instead of XIRR(B1:Z1,B2:Z2), use XIRR(A1:Y1,A2:Y2).
If you do not want hard-code the right-most cell references, there are ways
to determine the right-most value. For example,
INDEX(B1:Z1,1,MATCH(2,1/$B$1:$Z$1)). That must be in an array-entered
formula (press ctrl+shift+Enter instead of just Enter). Change Z1 to the
right-most cell that you expect to use.
|