IRR on range with condition?

I have a table INVESTMENTS like so:

     A      B        C
1  Date, Company, Investment
2  01/01/23, Foo, -100
3  01/01/23, Bar, -100
4  01/01/23, Biz, -100
5  01/02/23, Foo, -240
6  01/02/23, Bar, -200
7  01/02/23, Biz, -100
8  01/03/23, Foo, -100
9  01/03/23, Bar, -300
10 01/03/23, Biz, -200

And another PRESENTVALUE like so:

    A      B       C
1 Date, Company, Value
2 Today(), Foo, 50
3 Today(), Bar, 200
4 Today(), Biz, 150

How can I add an IRR column to PRESENTVALUE table, for each company? I tried several variations of the following with Ctrl+Shift+Enter for array formula:

   A      B      C     D
1 Date, Company, Value, IRR
2 Today(), Foo, 50, IRR(IF($INVESTMENTS.B:$INVESTMENTS.B=B2,$INVESTMENTS.C:$INVESTMENTS:C) & C2))
3 Today(), Bar, 200, IRR(IF($INVESTMENTS.B:$INVESTMENTS.B=B3,$INVESTMENTS.C:$INVESTMENTS:C) & C3))
4 Today() ,Biz, 150, IRR(IF($INVESTMENTS.B:$INVESTMENTS.B=B4,$INVESTMENTS.C:$INVESTMENTS:C) & C3))

To no avail. I’ve also found the following answer: XIRR with filtered ranges?, which is similar, but not exactly what I need.

Re-organizing the tables manually is not an option, as the actual tables are large and grow regularly.

For IRR(), investments and payments must be in one array and include at least one negative and one positive value, so that table layout listing only negative investment values will simply not work. Concatenating the array with C2 or C3 makes no sense. It seems you want to append that value? Arrays don’t work that way. With & C2 you are appending the value of C2 in text form to each element of the array, resulting in text like -10050 (-100 & 50) or 050 (0 & 50), which IRR() chokes on anyway. I also doubt you want to use IRR() at all, because you only have investment sums and one present value (a current quote?), there are no payouts.

1 Like