Ajuda del LibreOffice 24.8
Calculates the Net Present Value of an investment, based on a supplied discount rate, and a series of deposits and withdrawals.
NPV (Rate as Double, Values() as Double)
Double
Taxa és la taxa de descompte d'un període.
Valors() és una matriu que representa dipòsits (valors positius) o retirades (valors negatius).
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 ' retorna 174,894967305331
End Sub