# IRR 函数IRR function

## 语法Syntax

IRR(values()、[ guess ])IRR(values(), [ guess ])

IRR 函数具有以下命名参数The IRR function has these named arguments:

PartPart 说明Description
()values() 必需。Required. 用于指定现金流值的双精度数组Array of Double specifying cash flow values. 该数组必须包含至少一个负值（付款）和一个正值（收款）。The array must contain at least one negative value (a payment) and one positive value (a receipt).

## 备注Remarks

IRR 函数使用数组内值的顺序来解释付款和收款的顺序。The IRR function uses the order of values within the array to interpret the order of payments and receipts. 确保按正确的顺序输入付款和收款值。Be sure to enter your payment and receipt values in the correct sequence. 每个期间的现金流不必是固定的，因为它针对年金。The cash flow for each period doesn't have to be fixed, as it is for an annuity.

IRR 通过迭代计算。IRR is calculated by iteration. guess 值开始，IRR 循环执行计算，直到结果的精度达到 0.00001% 以内。Starting with the value of guess, IRR cycles through the calculation until the result is accurate to within 0.00001 percent. 如果 IRR 在尝试 20 次后还无法得出结果，它将失败。If IRR can't find a result after 20 tries, it fails.

## 示例Example

``````Dim Guess, Fmt, RetRate, Msg
Static Values(5) As Double    ' Set up array.
Guess = .1    ' Guess starts at 10 percent.
Fmt = "#0.00"    ' Define percentage format.
Values(0) = -70000    ' Business start-up costs.
' Positive cash flows reflecting income for four successive years.
Values(1) = 22000 : Values(2) = 25000
Values(3) = 28000 : Values(4) = 31000
RetRate = IRR(Values(), Guess) * 100    ' Calculate internal rate.
Msg = "The internal rate of return for these five cash flows is "
Msg = Msg & Format(RetRate, Fmt) & " percent."
MsgBox Msg    ' Display internal return rate.

``````