S
Sharon
Hi all,
I would like to trap the #NUM error that happens only occasionally with the IRR function. I decided
against added more to the formula since I couldn't figure out a simple way to do it (without
enclosing each IRR function with an ISERROR function)
The function I wrote is below but now it returns the #VALUE error. Is there a simple way to do this
or can my function be fixed?
***************************
the formula:
=IF(Period=1,IRR($O$46:$O$47,-0.9),
IF(Period=3,IRR($O$46:$O$49,-0.9),IF(Period=4,IRR($O$46:$O$50,-0.9),
IF(Period=5,IRR($O$46:$O$51,-0.9),"N/A"))))
the function:
Public Function InternalRR(Netflows As Range, drate As Double) As Variant
' return the result from Excel's IRR function trapping the #NUM error
Application.Volatile True
If WorksheetFunction.IsError(WorksheetFunction.IRR(Netflows, drate)) Then
InternalRR = "N/A"
Else
InternalRR = WorksheetFunction.IRR(Netflows, drate)
End If
End Function
*****************
Thanks,
Sharon
I would like to trap the #NUM error that happens only occasionally with the IRR function. I decided
against added more to the formula since I couldn't figure out a simple way to do it (without
enclosing each IRR function with an ISERROR function)
The function I wrote is below but now it returns the #VALUE error. Is there a simple way to do this
or can my function be fixed?
***************************
the formula:
=IF(Period=1,IRR($O$46:$O$47,-0.9),
IF(Period=3,IRR($O$46:$O$49,-0.9),IF(Period=4,IRR($O$46:$O$50,-0.9),
IF(Period=5,IRR($O$46:$O$51,-0.9),"N/A"))))
the function:
Public Function InternalRR(Netflows As Range, drate As Double) As Variant
' return the result from Excel's IRR function trapping the #NUM error
Application.Volatile True
If WorksheetFunction.IsError(WorksheetFunction.IRR(Netflows, drate)) Then
InternalRR = "N/A"
Else
InternalRR = WorksheetFunction.IRR(Netflows, drate)
End If
End Function
*****************
Thanks,
Sharon