Calculate XIRR for a specific "item" from a table that's sorted by date

vksy

New Member
Joined
Feb 23, 2021
Messages
4
Office Version
  1. 2019
Platform
  1. Windows
The following sheet contains multiple items and their respective cash flows in one table. All entries are sorted by item in order to make the XIRR function work.

XIRR.xlsx
ABCDEFG
1ItemDateAmountItemXIRR
2X5/6/12825X0.0843
3X7/22/12-100Y0.0856
4X12/18/15675Z0.0801
5X11/14/19475
6X12/31/20-3,000
7Y6/13/13775
8Y2/1/14-50
9Y3/28/14600
10Y10/8/18500
11Y12/31/20-3,000
12Z8/2/13575
13Z1/1/15850
14Z4/13/16-100
15Z9/5/17600
16Z12/31/20-3,000
17
18
19
20
Sheet1
Cell Formulas
RangeFormula
F2:F4F2=XIRR(OFFSET(C$2,MATCH(E2,A$2:A$18,0)-1,0,COUNTIF(A$2:A$18,E2)),OFFSET(B$2,MATCH(E2,A$2:A$18,0)-1,0,COUNTIF(A$2:A$18,E2)))


There is just one problem. The layout isn't very user friendly. A row needs to be inserted for every future entry. This can be problematic in a big table with many cash flows. As shown below, the ideal solution would be to sort by date. For new entries, just find the bottom.

XIRR.xlsx
ABCDEFGHI
1ItemDateAmountItemDateAmountXIRR
2X5/6/12825X12/31/20-3,000?
3X7/22/12-100Y12/31/20-3,000?
4Y6/13/13775Z12/31/20-3,000?
5Z8/2/13575Overall12/31/20-9,000?
6Y2/1/14-50
7Y3/28/14600
8Z1/1/15850
9X12/18/15675
10Z4/13/16-100
11Z9/5/17600
12Y10/8/18500
13X11/14/19475
14
15
16
17
18
19
20
Sheet2


And this is where I'm hitting a wall. Please help with the XIRR formula for this particular scenario. Many thanks.
 
Big thanks to DRSteele and joeu2004 for responding.

DRSteele... I use Office 2019 (standalone) that doesn't receive the latest and greatest subscription updates. Hopefully, your post will help the next person with Office 365.

joeu2004... Your solution works extremely well and have already streamlined my worksheet. I did remove column J since you mentioned those formulas were unnecessary.
 
Upvote 0

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
You're welcome.

You and 04 might want to consider upgrading your software if possible. Office 365 with its new calculation engine, dynamic arrays and broad suite of new functions is worth every penny.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top