From ed5640d8b587fbcfed7dd7967f3de04b37a76f26 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:06:44 +0200 Subject: Adding upstream version 4:7.4.7. Signed-off-by: Daniel Baumann --- .../source/text/sbasic/shared/03140006.xhp | 77 ++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 helpcontent2/source/text/sbasic/shared/03140006.xhp (limited to 'helpcontent2/source/text/sbasic/shared/03140006.xhp') diff --git a/helpcontent2/source/text/sbasic/shared/03140006.xhp b/helpcontent2/source/text/sbasic/shared/03140006.xhp new file mode 100644 index 000000000..94b4b9bbd --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03140006.xhp @@ -0,0 +1,77 @@ + + + + + + + NPV Function [VBA] + /text/sbasic/shared/03140006.xhp + + + + + + +
+ + NPV function + + + +NPV Function [VBA] +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 + +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 + + +
+NPV function in CALC + +
+ + +
-- cgit v1.2.3