[gnumeric] Docs: RATE, IRR, XIRR converted.



commit 4955313cfe27297d423d3940c826e624bb5fa462
Author: Morten Welinder <terra gnome org>
Date:   Thu Aug 6 09:52:00 2009 -0400

    Docs: RATE, IRR, XIRR converted.

 plugins/fn-financial/functions.c |   92 ++++++++++---------------------------
 1 files changed, 25 insertions(+), 67 deletions(-)
---
diff --git a/plugins/fn-financial/functions.c b/plugins/fn-financial/functions.c
index 2f75dfb..a226419 100644
--- a/plugins/fn-financial/functions.c
+++ b/plugins/fn-financial/functions.c
@@ -1302,20 +1302,17 @@ gnumeric_tbillyield (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
 /***************************************************************************/
 
 static GnmFuncHelp const help_rate[] = {
-	{ GNM_FUNC_HELP_OLD,
-	F_("@FUNCTION=RATE\n"
-	   "@SYNTAX=RATE(nper,pmt,pv[,fv,type,guess])\n"
-	   "@DESCRIPTION="
-	   "RATE calculates the rate of an investment.\n"
-	   "\n"
-	   "* If @pmt is omitted it defaults to 0\n"
-	   "* If @nper <= 0, RATE returns #NUM! error.\n"
-	   "* If @type != 0 and @type != 1, RATE returns #VALUE! error.\n"
-	   "\n"
-	   "@EXAMPLES=\n"
-	   "\n"
-	   "@SEEALSO=PV,FV")
-	},
+        { GNM_FUNC_HELP_NAME, F_("RATE:calculate rate of investment")},
+        { GNM_FUNC_HELP_ARG, F_("nper:number of periods")},
+        { GNM_FUNC_HELP_ARG, F_("pmt:payment at each period")},
+        { GNM_FUNC_HELP_ARG, F_("pv:present value")},
+        { GNM_FUNC_HELP_ARG, F_("fv:future value")},
+	TYPE_HELP,
+        { GNM_FUNC_HELP_ARG, F_("guess:a estimate of what the result should be")},
+	{ GNM_FUNC_HELP_DESCRIPTION, F_("RATE calculates the rate of return.") },
+	{ GNM_FUNC_HELP_NOTE, F_("The optional @{guess} is needed because there can be more than one valid result.  It defaults to 10%.") },
+        { GNM_FUNC_HELP_EXAMPLES, "=RATE(10,-1500,10000,0)" },
+        { GNM_FUNC_HELP_SEEALSO, "PV,FV"},
 	{ GNM_FUNC_HELP_END }
 };
 
@@ -1418,30 +1415,13 @@ gnumeric_rate (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
 /***************************************************************************/
 
 static GnmFuncHelp const help_irr[] = {
-	{ GNM_FUNC_HELP_OLD,
-	F_("@FUNCTION=IRR\n"
-	   "@SYNTAX=IRR(values[,guess])\n"
-	   "@DESCRIPTION="
-	   "IRR calculates and returns the internal rate of return of an "
-	   "investment.  This function is closely related to the net present "
-	   "value function (NPV).  The IRR is the interest rate for a "
-	   "series of cash flows where the net preset value is zero.\n"
-	   "\n"
-	   "@values contains the series of cash flows generated by the "
-	   "investment.  The payments should occur at regular intervals.  "
-	   "The optional @guess is the initial value used in calculating "
-	   "the IRR.  You do not have to use that, it is only provided "
-	   "for the Excel compatibility.\n"
-	   "\n"
-	   "* This function is Excel compatible.\n"
-	   "\n"
-	   "@EXAMPLES=\n"
-	   "Let us assume that the cells A1:A8 contain the numbers -32432, "
-	   "5324, 7432, 9332, 12324, 4334, 1235, -3422.  Then\n"
-	   "IRR(A1:A8) returns 0.04375. "
-	   "\n"
-	   "@SEEALSO=FV,NPV,PV")
-	},
+        { GNM_FUNC_HELP_NAME, F_("IRR:calculate internal rate of return")},
+        { GNM_FUNC_HELP_ARG, F_("values:cash flow")},
+        { GNM_FUNC_HELP_ARG, F_("guess:a estimate of what the result should be")},
+	{ GNM_FUNC_HELP_DESCRIPTION, F_("IRR calculates the internal rate of return of a cash flow with periodic payments.  @{values} lists the payments (negative values) and receipts (positive values) for each period.") },
+        { GNM_FUNC_HELP_EXAMPLES, "=IRR({100;100;200;-450})" },
+	{ GNM_FUNC_HELP_NOTE, F_("The optional @{guess} is needed because there can be more than one valid result.  It defaults to 10%.") },
+        { GNM_FUNC_HELP_SEEALSO, "XIRR"},
 	{ GNM_FUNC_HELP_END }
 };
 
@@ -1704,35 +1684,13 @@ gnumeric_xnpv (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
 /***************************************************************************/
 
 static GnmFuncHelp const help_xirr[] = {
-	{ GNM_FUNC_HELP_OLD,
-	F_("@FUNCTION=XIRR\n"
-	   "@SYNTAX=XIRR(values,dates[,guess])\n"
-	   "@DESCRIPTION="
-	   "XIRR calculates and returns the internal rate of return of an "
-	   "investment that has not necessarily periodic payments.  This "
-	   "function is closely related to the net present value function "
-	   "(NPV and XNPV).  The XIRR is the interest rate for a "
-	   "series of cash flows where the XNPV is zero.\n"
-	   "\n"
-	   "@values contains the series of cash flows generated by the "
-	   "investment.  @dates contains the dates of the payments.  The "
-	   "first date describes the payment day of the initial payment and "
-	   "thus all the other dates should be after this date. "
-	   "The optional @guess is the initial value used in calculating "
-	   "the XIRR.  You do not have to use that, it is only provided "
-	   "for the Excel compatibility.\n"
-	   "\n"
-	   "* This function is Excel compatible.\n"
-	   "\n"
-	   "@EXAMPLES=\n"
-	   "Let us assume that the cells A1:A5 contain the numbers -6000, "
-	   "2134, 1422, 1933, and 1422, and the cells B1:B5 contain the "
-	   "dates \"1999-01-15\", \"1999-04-04\", \"1999-05-09\", "
-	   "\"2000-03-12\", and \"2000-05-1\". Then\n"
-	   "XIRR(A1:A5,B1:B5) returns 0.224838. "
-	   "\n"
-	   "@SEEALSO=IRR,XNPV")
-	},
+        { GNM_FUNC_HELP_NAME, F_("XIRR:calculate internal rate of return")},
+        { GNM_FUNC_HELP_ARG, F_("values:cash flow")},
+        { GNM_FUNC_HELP_ARG, F_("dates:date of cash flow")},
+        { GNM_FUNC_HELP_ARG, F_("guess:a estimate of what the result should be")},
+	{ GNM_FUNC_HELP_DESCRIPTION, F_("XIRR calculates the annualized internal rate of return of a cash flow at arbitrary points in time.  @{values} lists the payments (negative values) and receipts (positive values) with one value for each entry in @{dates}.") },
+	{ GNM_FUNC_HELP_NOTE, F_("The optional @{guess} is needed because there can be more than one valid result.  It defaults to 10%.") },
+        { GNM_FUNC_HELP_SEEALSO, "IRR"},
 	{ GNM_FUNC_HELP_END }
 };
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]