Ajuda do LibreOffice 24.8
Calcula o valor atual líquido de um investimento, baseado na taxa de desconto fornecida, e com uma série de depósitos e levantamentos.
NPV (Rate as Double, Values() as Double)
Double
Rate is the discount rate for a period.
Values() is an array that represent deposits (positive values) or withdrawals (negative values).
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 ' returns 174,894967305331
End Sub