# XIRR with expected negative rate of return gives Err:502 [closed]

Sometimes when I get a negative rate of return with the XIRR function I get a Err:502. I did some testing today. I have my spreadsheet entries the opposite of examples I see. I thought that might be the problem. The latest entry at the top instead of bottom as typically shown. First I did a simple example in each order

=XIRR(B6:B8,A6:A8,0.1)

05/22/13 28384.68 39.35%

01/27/14 7999.99

01/28/14 -43667.92

=XIRR(E6:E8,D6:D8,0.1)

01/28/14 -43667.92 39.35%

01/27/14 7999.99

05/22/13 28384.68

Both seem to work correctly. It doesn't seem to matter the order of the entries. Then I changed the ending total so the result would be negative.

05/22/13 28384.68 Err:502

01/27/14 7999.99

01/28/14 -23667.92

01/28/14 -23667.92 -57.78%

01/27/14 7999.99

05/22/13 28384.68

Now the order makes a difference! But it is the opposite of what I expected. As my entries that give Err:502 are in the order given in most examples.

Here is an actual failure I get

=XIRR(E13:E14,B13:B14,0.4) Err:502

01/28/2014 ($4,811.29)

01/23/2014 23.464 $213.09 $4,999.94

What am I doing wrong that I get an Err:502 instead of showing a negative rate of return? I have tried negative numbers in the guestamation without help.