Friday, September 10, 2010

Visual Basic Financial Function : NPV

Purpose : The NPV function returns the net present value of a varying series of periodic cash flows ( both negative and positive ) at a given discount rate.

Syntax :
NPV ( dblDiscountRate , dblValuesArray ( ) )

dblDiscountRate : Discount rate
dblValuesArray : Array of cash flows

dblMoney(0) = -50000
dblMoney(1) = -25000
dblMoney(2) = 0
dblMoney(3) = 10000
dblMoney(4) = 30000
dblMoney(5) = 50000
dblMoney(6) = 200000
dblDiscountRate = 0.1 ' ten percent APR

dblReturn = NPV ( dblDiscountRate , dblMoney ( ) )

No comments:

Post a Comment