XIRR on only visible cells / filtered data

dantab

New Member
Joined
Jun 15, 2013
Messages
2
Hi

I am trying to apply the XIRR formula to data that I have selected by a filter. I want the result of the XIRR formula to take into account only the rows of data that are visible after being filtered.

My current formula is:
=XIRR(H2:H22,A2:A22), but this takes into account all rows (whether they are viable or not).

Any ideas?

Thanks
Dan
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
I'd suggest that you copy the filtered data to another location, and use your formula there. Otherwise, try the following formula that needs to be confirmed with CTRL+SHIFT+ENTER...

=XIRR(N(OFFSET(H2:H22,SMALL(IF(SUBTOTAL(3,OFFSET(A2:A22,ROW(A2:A22)-ROW(A2),0,1)),ROW(A2:A22)-ROW(A2)),ROW(INDIRECT("1:"&SUBTOTAL(3,A2:A22)))),0,1)),N(OFFSET(A2:A22,SMALL(IF(SUBTOTAL(3,OFFSET(A2:A22,ROW(A2:A22)-ROW(A2),0,1)),ROW(A2:A22)-ROW(A2)),ROW(INDIRECT("1:"&SUBTOTAL(3,A2:A22)))),0,1)))
 
Last edited:
Upvote 0
I'd suggest that you copy the filtered data to another location, and use your formula there. Otherwise, try the following formula that needs to be confirmed with CTRL+SHIFT+ENTER...

=XIRR(N(OFFSET(H2:H22,SMALL(IF(SUBTOTAL(3,OFFSET(A2:A22,ROW(A2:A22)-ROW(A2),0,1)),ROW(A2:A22)-ROW(A2)),ROW(INDIRECT("1:"&SUBTOTAL(3,A2:A22)))),0,1)),N(OFFSET(A2:A22,SMALL(IF(SUBTOTAL(3,OFFSET(A2:A22,ROW(A2:A22)-ROW(A2),0,1)),ROW(A2:A22)-ROW(A2)),ROW(INDIRECT("1:"&SUBTOTAL(3,A2:A22)))),0,1)))

Hi, can you please explain how this formula works? Thanks
 
Upvote 0

Forum statistics

Threads
1,216,099
Messages
6,128,823
Members
449,470
Latest member
Subhash Chand

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