WorksheetFunction.Irr Method

Returns the internal rate of return for a series of cash flows represented by the numbers in values. These cash flows do not have to be even, as they would be for an annuity. However, the cash flows must occur at regular intervals, such as monthly or annually. The internal rate of return is the interest rate received for an investment consisting of payments (negative values) and income (positive values) that occur at regular periods.

Namespace:  Microsoft.Office.Interop.Excel
Assembly:  Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)

Syntax

'Declaration
Function Irr ( _
    Arg1 As Object, _
    Arg2 As Object _
) As Double
'Usage
Dim instance As WorksheetFunction
Dim Arg1 As Object
Dim Arg2 As Object
Dim returnValue As Double

returnValue = instance.Irr(Arg1, Arg2)
double Irr(
    Object Arg1,
    Object Arg2
)

Parameters

  • Arg1
    Type: System.Object

    Values - an array or a reference to cells that contain numbers for which you want to calculate the internal rate of return.

  • Arg2
    Type: System.Object

    Guess - a number that you guess is close to the result of IRR.

Return Value

Type: System.Double

Remarks

Values must contain at least one positive value and one negative value to calculate the internal rate of return.

IRR uses the order of values to interpret the order of cash flows. Be sure to enter your payment and income values in the sequence you want.

If an array or reference argument contains text, logical values, or empty cells, those values are ignored.

Microsoft Excel uses an iterative technique for calculating Irr. Starting with guess, Irr cycles through the calculation until the result is accurate within 0.00001 percent. If Irr can't find a result that works after 20 tries, the #NUM! error value is returned.

In most cases you do not need to provide guess for the Irr calculation. If guess is omitted, it is assumed to be 0.1 (10 percent).

If Irr gives the #NUM! error value, or if the result is not close to what you expected, try again with a different value for guess.

Irr is closely related to Npv(Double, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object), the net present value function. The rate of return calculated by Irr is the interest rate corresponding to a 0 (zero) net present value. The following formula demonstrates how Npv(Double, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object) and Irr are related:

NPV(IRR(B1:B6),B1:B6) equals 3.60E-08 [Within the accuracy of the Irr calculation, the value 3.60E-08 is effectively 0 (zero).]

See Also

Reference

WorksheetFunction Interface

WorksheetFunction Members

Microsoft.Office.Interop.Excel Namespace