Xirr

liz23

New Member
Joined
Aug 12, 2008
Messages
9
Is it posssible to use the xirr function with conditions. For example, an array formula that will only calculate xirr if a column meets a certain criteria or if the dates are within a range?
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Welcome to the board

I'm not familiar with te xirr function, but you can make an array formula that will execute the xirr only on rows that meet criteria..

something like this

=XIRR(IF(A1:A100="X",B1:B100))

That would be the same as
=XIRR(B1:B100) - but only count rows where column A = X

Array formula entered with CTRL + SHIFT + ENTER

Hope that helps...
 
Upvote 0
thanks! i actually tried that, but the xirr function requires two inputs, the dates as well as the cash flows. so when i add an additional comma for the cash flows, it assumes i am applying the value if false.

do you have any suggestions to fix this?
 
Upvote 0
OK, this is due to my non familiarity with xirr...

You would need the IF in BOTH arguments of the xirr function...

so say the xirr formula is
=xirr(a1:a100,b1:b100)
and your criteria is column C = X

=XIRR(IF(C1:C100="X",A1:A100),IF(C1:C100="X",B1:B100))

I think that will work...
 
Upvote 0
Leave the dates alone and use a 0 value for inflows/outflows in the IF statement. Here I have dates in A1:A10, values in B1:B10, and X or blank in C1:C10

=XIRR(IF(C1:C10="X",B1:B10,0),A1:A10)

Use Ctrl+Shift+Enter.
 
Upvote 0
i tried putting the xirr within the if statement, also tried the last formula as well (=XIRR(IF(C1:C10="X",B1:B10,0),A1:A10))...but neither work.

thanks again for everyone's help. i am getting #NUM! errors with the last formula and the same answer for the xirr within the if statement.
 
Upvote 0
If you get a #NUM error, that means set does not converge. In other words, given the input values, XNPV is always less than 0 or always more than 0, regardless of the discount rate.
 
Upvote 0
but the odd thing is if i do it manually...i get a value.

also...if i do it manually by actually choosing the dates, then refresh, the formula works sometimes.
 
Upvote 0

Forum statistics

Threads
1,223,625
Messages
6,173,392
Members
452,514
Latest member
cjkelly15

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