From 8837573f15693f8de45618fc1b3342d87de88ae6 Mon Sep 17 00:00:00 2001 From: Olivier Hallot Date: Fri, 16 Jun 2017 16:54:14 -0300 Subject: tdf#84675 Add help page for IRR function of VBA Change-Id: If4218b4b9619766e25676d5c4be35db42d51b007 Reviewed-on: https://gerrit.libreoffice.org/38900 Reviewed-by: Olivier Hallot Tested-by: Olivier Hallot --- AllLangHelp_sbasic.mk | 1 + source/auxiliary/sbasic.tree | 1 + source/text/sbasic/shared/03140003.xhp | 77 ++++++++++++++++++++++++++ source/text/sbasic/shared/special_vba_func.xhp | 2 +- 4 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 source/text/sbasic/shared/03140003.xhp diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index d2435e0026..731bb7d46b 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -327,6 +327,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03140000 \ helpcontent2/source/text/sbasic/shared/03140001 \ helpcontent2/source/text/sbasic/shared/03140002 \ + helpcontent2/source/text/sbasic/shared/03140003 \ helpcontent2/source/text/sbasic/shared/05060700 \ helpcontent2/source/text/sbasic/shared/code-stubs \ helpcontent2/source/text/sbasic/shared/keys \ diff --git a/source/auxiliary/sbasic.tree b/source/auxiliary/sbasic.tree index 9448d65874..d95a88c484 100644 --- a/source/auxiliary/sbasic.tree +++ b/source/auxiliary/sbasic.tree @@ -160,6 +160,7 @@ Input# Statement [Runtime] Int Function [Runtime] IPmt Function [Runtime - VBA] +IRR Function [Runtime - VBA] IsArray Function [Runtime] IsDate Function [Runtime] IsEmpty Function [Runtime] diff --git a/source/text/sbasic/shared/03140003.xhp b/source/text/sbasic/shared/03140003.xhp new file mode 100644 index 0000000000..cd5fc6f755 --- /dev/null +++ b/source/text/sbasic/shared/03140003.xhp @@ -0,0 +1,77 @@ + + + + + + + IRR Function [Runtime - VBA] + /text/sbasic/shared/03140003.xhp + + + + + + +
+ + IRR function + + + +IRR Function [Runtime - VBA] +Calculates the internal rate of return for an investment. +
+ + + + +IRR(Values() as Double , [Guess as Variant]) + + + +Double + + +Values(): The array of values of the cash-flow. The values represent cash flow values at regular intervals, at least one value must be negative (payments), and at least one value must be positive (income). +Guess An initial estimate at what the IRR will be. + + + + + +REM ***** BASIC ***** +Option VBASupport 1 +Sub ExampleIRR + Dim cashFlow(0 to 3) As Double + cashFlow(0) = -10000 + cashFlow(1) = 3500 + cashFlow(2) = 7600 + cashFlow(3) = 1000 + irrValue = IRR(cashFlow) * 100 + Print irrValue ' returns 11.3321028236252 . The internal rate of return of the cash flow. +End Sub + + +
+IRR function in CALC +VBA financial functions +
+ + +
\ No newline at end of file diff --git a/source/text/sbasic/shared/special_vba_func.xhp b/source/text/sbasic/shared/special_vba_func.xhp index 582e2ce0e1..12d68f22e0 100644 --- a/source/text/sbasic/shared/special_vba_func.xhp +++ b/source/text/sbasic/shared/special_vba_func.xhp @@ -76,7 +76,7 @@ IPmt - IRR + IRR MIRR -- cgit