This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!
NPV Function Example
This example uses the
NPV function to return the net present value for a series of cash flows contained in the array
Values()
.
RetRate
represents the fixed internal rate of return.
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.