# NPV 函数NPV function

## 语法Syntax

NPV(rate, values())NPV(rate, values( ))

NPV 函数包含以下命名参数The NPV function has these named arguments:

PartPart 说明Description
rate 必需。Required. 指定以小数表示的期间内的贴现率的 DoubleDouble specifying discount rate over the length of the period, expressed as a decimal.
( )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

NPV 函数使用数组中的值的顺序来解释付款和收款的顺序。The NPV 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.

NPV 投资在第一个现金流值的日期之前的一个期间开始，并以数组中的最后一个现金流值结束。The NPV investment begins one period before the date of the first cash flow value and ends with the last cash flow value in the array.

NPV函数类似于**pv** 函数 (现值), 不同之处在于pv函数允许现金流在周期结束或开始时开始。The NPV function is similar to the PV function (present value) except that the PV function allows cash flows to begin either at the end or the beginning of a period. 与可变的 NPV 现金流值不同，PV 现金流在投资期间必须是固定的。Unlike the variable NPV cash flow values, PV cash flows must be fixed throughout the investment.

## 示例Example

``````Dim Fmt, Guess, RetRate, NetPVal, Msg
Static Values(5) As Double    ' Set up array.
Fmt = "###,##0.00"    ' Define money format.
Guess = .1    ' Guess starts at 10 percent.
RetRate = .0625    ' Set fixed internal rate.
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
NetPVal = NPV(RetRate, Values())    ' Calculate net present value.
Msg = "The net present value of these cash flows is "
Msg = Msg & Format(NetPVal, Fmt) & "."
MsgBox Msg    ' Display net present value.
``````