NPV-functie [VBA]

Berekent de netto huidige waarde van een investering op basis van een verstrekte discontovoet en een reeks stortingen en opnames.

warning

This function or constant is enabled with the statement Option VBASupport 1 placed before the executable program code in a module.


Syntaxis:


NPV (Rate as Double, Values() as Double)

Geretourneerde waarde:

Double

Parameters:

Koers is de kortingskoers voor een periode.

Waarden() is een matrix die deposito's (positieve waarden) of onttrekkingen (negatieve waarden) vertegenwoordigt.

Foutcodes:

5 Ongeldige aanroep van procedure

Voorbeeld:


REM ***** BASIC *****
Option VBASupport 1
Sub ExampleNPV
 Dim r As Double
 Dim pValues(5) as Double
 pValues(0) = 100
 pValues(1) = 100
 pValues(2) = 100
 pValues(3) = -300
 pValues(4) = 100
 pValues(5) = 100
 r = 0.06
 p = NPV( r, pValues)
 Print p ' geeft 174,894967305331
End Sub