xref: /trunk/main/helpcontent2/source/text/scalc/01/04060111.xhp (revision d52405488e151828d937b61852bbaa40bd8274f3)
1cdf0e10cSrcweir<?xml version="1.0" encoding="UTF-8"?>
2cdf0e10cSrcweir
352ac0773SAndrew Rist<!--***********************************************************
4cdf0e10cSrcweir *
552ac0773SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
652ac0773SAndrew Rist * or more contributor license agreements.  See the NOTICE file
752ac0773SAndrew Rist * distributed with this work for additional information
852ac0773SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
952ac0773SAndrew Rist * to you under the Apache License, Version 2.0 (the
1052ac0773SAndrew Rist * "License"); you may not use this file except in compliance
1152ac0773SAndrew Rist * with the License.  You may obtain a copy of the License at
12cdf0e10cSrcweir *
1352ac0773SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
14cdf0e10cSrcweir *
1552ac0773SAndrew Rist * Unless required by applicable law or agreed to in writing,
1652ac0773SAndrew Rist * software distributed under the License is distributed on an
1752ac0773SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1852ac0773SAndrew Rist * KIND, either express or implied.  See the License for the
1952ac0773SAndrew Rist * specific language governing permissions and limitations
2052ac0773SAndrew Rist * under the License.
21cdf0e10cSrcweir *
2252ac0773SAndrew Rist ***********************************************************-->
2352ac0773SAndrew Rist
2411028d3cSmseidel<helpdocument version="1.0">
25cdf0e10cSrcweir<meta>
26cdf0e10cSrcweir<topic id="textscalc0104060111xml" indexer="include">
27cdf0e10cSrcweir<title id="tit" xml-lang="en-US">Add-in Functions</title>
28cdf0e10cSrcweir<filename>/text/scalc/01/04060111.xhp</filename>
29cdf0e10cSrcweir</topic>
30cdf0e10cSrcweir</meta>
31cdf0e10cSrcweir<body>
3288cae784Smseidel<bookmark xml-lang="en-US" branch="index" id="bm_id3150870">
3388cae784Smseidel<bookmark_value>add-ins; functions</bookmark_value>
34cdf0e10cSrcweir<bookmark_value>functions; add-in functions</bookmark_value>
35cdf0e10cSrcweir<bookmark_value>Function Wizard; add-ins</bookmark_value>
36cdf0e10cSrcweir</bookmark>
37*d5240548Smseidel<paragraph role="heading" id="hd_id3150870" xml-lang="en-US" level="1" l10n="U">Add-in Functions</paragraph>
38*d5240548Smseidel<paragraph role="paragraph" id="par_id3147427" xml-lang="en-US" l10n="CHG"><variable id="addintext">The following describes and lists some of the available add-in functions.</variable></paragraph>
39*d5240548Smseidel<paragraph role="paragraph" id="par_id3163713" xml-lang="en-US" l10n="U"><link href="text/scalc/01/04060112.xhp#addinconcept">Add-in concept</link></paragraph>
40*d5240548Smseidel<paragraph role="paragraph" id="par_id3146120" xml-lang="en-US" l10n="U">You will also find a <link href="text/scalc/01/04060112.xhp">description of the $[officename] Calc add-in interface</link> in the Help. In addition, important functions and their parameters are described in the Help for the <switchinline select="sys"><caseinline select="UNIX">Shared Library
41cdf0e10cSrcweir</caseinline><defaultinline>$[officename] Calc add-in DLL</defaultinline></switchinline>.</paragraph>
42*d5240548Smseidel<paragraph role="heading" id="hd_id3151075" xml-lang="en-US" level="2" l10n="U">Add-ins supplied</paragraph>
43*d5240548Smseidel<paragraph role="paragraph" id="par_id3156285" xml-lang="en-US" l10n="CHG">$[officename] contains examples for the add-in interface of $[officename] Calc.</paragraph>
44*d5240548Smseidel<paragraph role="paragraph" id="par_id3159267" xml-lang="en-US" l10n="U"><link href="text/scalc/01/04060115.xhp">Analysis Functions Part One</link></paragraph>
45*d5240548Smseidel<paragraph role="paragraph" id="par_id3154703" xml-lang="en-US" l10n="U"><link href="text/scalc/01/04060116.xhp">Analysis Functions Part Two</link></paragraph>
46cdf0e10cSrcweir<sort order="asc">
47cdf0e10cSrcweir<section id="isleapyear">
4888cae784Smseidel<bookmark xml-lang="en-US" branch="index" id="bm_id3149566">
4988cae784Smseidel<bookmark_value>ISLEAPYEAR function</bookmark_value>
50cdf0e10cSrcweir<bookmark_value>leap year determination</bookmark_value>
51cdf0e10cSrcweir</bookmark><comment>mw added one entry</comment>
52*d5240548Smseidel<paragraph role="heading" id="hd_id3149566" xml-lang="en-US" level="2" l10n="U">ISLEAPYEAR</paragraph>
53*d5240548Smseidel<paragraph role="paragraph" id="par_id3150297" xml-lang="en-US" l10n="U"><ahelp hid=".">Determines whether a year is a leap year.</ahelp> If yes, the function will return the value 1 (TRUE); if not, it will return 0 (FALSE).</paragraph>
54*d5240548Smseidel<paragraph role="heading" id="hd_id3148487" xml-lang="en-US" level="3" l10n="U">Syntax</paragraph>
55*d5240548Smseidel<paragraph role="code" id="par_id3150205" xml-lang="en-US" l10n="U">ISLEAPYEAR("Date")</paragraph>
56*d5240548Smseidel<paragraph role="paragraph" id="par_id3159239" xml-lang="en-US" l10n="U"><emph>Date</emph> specifies whether a given date falls within a leap year. The Date parameter must be a valid date according to the locale settings of %PRODUCTNAME.</paragraph>
57*d5240548Smseidel<paragraph role="heading" id="hd_id3149817" xml-lang="en-US" level="3" l10n="U">Example</paragraph>
58*d5240548Smseidel<paragraph role="paragraph" id="par_id3150786" xml-lang="en-US" l10n="CHG">=ISLEAPYEAR(A1) returns 1, if A1 contains 1968-02-29, the valid date 29th of February 1968 in your locale setting.</paragraph>
59cdf0e10cSrcweir<paragraph role="paragraph" id="par_idN107E7" xml-lang="en-US" l10n="CHG">You may also use =ISLEAPYEAR("1968-02-29") or =ISLEAPYEAR("2/29/68").</paragraph>
60cdf0e10cSrcweir<paragraph role="paragraph" id="par_idN107EA" xml-lang="en-US" l10n="CHG">Never use =ISLEAPYEAR(2/29/68), because this would first evaluate 2 divided by 29 divided by 68, and then calculate the ISLEAPYEAR function from this small number as a serial date number.</paragraph>
61cdf0e10cSrcweir</section>
62cdf0e10cSrcweir<section id="years">
6388cae784Smseidel<bookmark xml-lang="en-US" branch="index" id="bm_id3154656">
6488cae784Smseidel<bookmark_value>YEARS function</bookmark_value>
65cdf0e10cSrcweir<bookmark_value>number of years between two dates</bookmark_value>
66cdf0e10cSrcweir</bookmark><comment>mw added one entry</comment>
67cdf0e10cSrcweir<bookmark xml-lang="en-US" branch="hid/SC_HID_DAI_FUNC_DIFFYEARS" id="bm_id3150368" localize="false"/>
68*d5240548Smseidel<paragraph role="heading" id="hd_id3154656" xml-lang="en-US" level="2" l10n="U">YEARS</paragraph>
69*d5240548Smseidel<paragraph role="paragraph" id="par_id3150886" xml-lang="en-US" l10n="U"><ahelp hid="HID_DAI_FUNC_DIFFYEARS">Calculates the difference in years between two dates.</ahelp></paragraph>
70*d5240548Smseidel<paragraph role="heading" id="hd_id3154370" xml-lang="en-US" level="3" l10n="U">Syntax</paragraph>
71*d5240548Smseidel<paragraph role="code" id="par_id3146114" xml-lang="en-US" l10n="U">YEARS(StartDate; EndDate; Type)</paragraph>
72*d5240548Smseidel<paragraph role="paragraph" id="par_id3145387" xml-lang="en-US" l10n="U"><emph>StartDate</emph> is the first date</paragraph>
73*d5240548Smseidel<paragraph role="paragraph" id="par_id3156290" xml-lang="en-US" l10n="U"><emph>EndDate</emph> is the second date</paragraph>
74*d5240548Smseidel<paragraph role="paragraph" id="par_id3152893" xml-lang="en-US" l10n="U"><emph>Type</emph> calculates the type of difference. Possible values are 0 (interval) and 1 (in calendar years).</paragraph>
75cdf0e10cSrcweir</section>
76cdf0e10cSrcweir<section id="months">
7788cae784Smseidel<bookmark xml-lang="en-US" branch="index" id="bm_id3152898">
7888cae784Smseidel<bookmark_value>MONTHS function</bookmark_value>
79cdf0e10cSrcweir<bookmark_value>number of months between two dates</bookmark_value>
80cdf0e10cSrcweir</bookmark><comment>mw added one entry</comment>
81cdf0e10cSrcweir<bookmark xml-lang="en-US" branch="hid/SC_HID_DAI_FUNC_DIFFMONTHS" id="bm_id3148839" localize="false"/>
82*d5240548Smseidel<paragraph role="heading" id="hd_id3152898" xml-lang="en-US" level="2" l10n="U">MONTHS</paragraph>
83*d5240548Smseidel<paragraph role="paragraph" id="par_id3153066" xml-lang="en-US" l10n="U"><ahelp hid="HID_DAI_FUNC_DIFFMONTHS">Calculates the difference in months between two dates.</ahelp></paragraph>
84*d5240548Smseidel<paragraph role="heading" id="hd_id3151240" xml-lang="en-US" level="3" l10n="U">Syntax</paragraph>
85*d5240548Smseidel<paragraph role="code" id="par_id3146869" xml-lang="en-US" l10n="U">MONTHS(StartDate; EndDate; Type)</paragraph>
86*d5240548Smseidel<paragraph role="paragraph" id="par_id3145075" xml-lang="en-US" l10n="U"><emph>StartDate</emph> is the first date</paragraph>
87*d5240548Smseidel<paragraph role="paragraph" id="par_id3157981" xml-lang="en-US" l10n="U"><emph>EndDate</emph> is the second date</paragraph>
88*d5240548Smseidel<paragraph role="paragraph" id="par_id3150111" xml-lang="en-US" l10n="U"><emph>Type</emph> calculates the type of difference. Possible values include 0 (interval) and 1 (in calendar months).</paragraph>
89cdf0e10cSrcweir</section>
90cdf0e10cSrcweir<section id="rot13">
9188cae784Smseidel<bookmark xml-lang="en-US" branch="index" id="bm_id3159094">
9288cae784Smseidel<bookmark_value>ROT13 function</bookmark_value>
93cdf0e10cSrcweir<bookmark_value>encrypting text</bookmark_value>
94cdf0e10cSrcweir</bookmark><comment>mw added one entry</comment>
95cdf0e10cSrcweir<bookmark xml-lang="en-US" branch="hid/SC_HID_DAI_FUNC_ROT13" id="bm_id3153283" localize="false"/>
96*d5240548Smseidel<paragraph role="heading" id="hd_id3159094" xml-lang="en-US" level="2" l10n="U">ROT13</paragraph>
97*d5240548Smseidel<paragraph role="paragraph" id="par_id3146781" xml-lang="en-US" l10n="U"><ahelp hid="HID_DAI_FUNC_ROT13">Encrypts a character string by moving the characters 13 positions in the alphabet.</ahelp> After the letter Z, the alphabet begins again (Rotation). By applying the encryption function again to the resulting code, you can decrypt the text.</paragraph>
98*d5240548Smseidel<paragraph role="heading" id="hd_id3150893" xml-lang="en-US" level="3" l10n="U">Syntax</paragraph>
99*d5240548Smseidel<paragraph role="code" id="par_id3159205" xml-lang="en-US" l10n="U">ROT13(Text)</paragraph>
100*d5240548Smseidel<paragraph role="paragraph" id="par_id3153249" xml-lang="en-US" l10n="U"><emph>Text</emph> is the character string to be encrypted. ROT13(ROT13(Text)) decrypts the code.</paragraph>
101cdf0e10cSrcweir</section>
102cdf0e10cSrcweir<section id="daysinyear">
10388cae784Smseidel<bookmark xml-lang="en-US" branch="index" id="bm_id3151300">
10488cae784Smseidel<bookmark_value>DAYSINYEAR function</bookmark_value>
105cdf0e10cSrcweir<bookmark_value>number of days; in a specific year</bookmark_value>
106cdf0e10cSrcweir</bookmark><comment>mw added one entry</comment>
107cdf0e10cSrcweir<bookmark xml-lang="en-US" branch="hid/SC_HID_DAI_FUNC_DAYSINYEAR" id="bm_id3153972" localize="false"/>
108*d5240548Smseidel<paragraph role="heading" id="hd_id3151300" xml-lang="en-US" level="2" l10n="U">DAYSINYEAR</paragraph>
109*d5240548Smseidel<paragraph role="paragraph" id="par_id3143220" xml-lang="en-US" l10n="CHG"><ahelp hid="HID_DAI_FUNC_DAYSINYEAR">Calculates the number of days of the year in which the date entered occurs.</ahelp></paragraph>
110*d5240548Smseidel<paragraph role="heading" id="hd_id3145358" xml-lang="en-US" level="3" l10n="U">Syntax</paragraph>
111*d5240548Smseidel<paragraph role="code" id="par_id3154651" xml-lang="en-US" l10n="U">DAYSINYEAR(Date)</paragraph>
112*d5240548Smseidel<paragraph role="paragraph" id="par_id3153803" xml-lang="en-US" l10n="CHG"><emph>Date</emph> is any date in the respective year. The Date parameter must be a valid date according to the locale settings of %PRODUCTNAME.</paragraph>
113*d5240548Smseidel<paragraph role="heading" id="hd_id3153487" xml-lang="en-US" level="3" l10n="U">Example</paragraph>
114*d5240548Smseidel<paragraph role="paragraph" id="par_id3153811" xml-lang="en-US" l10n="CHG">=DAYSINYEAR(A1) returns 366 days if A1 contains 1968-02-29, a valid date for the year 1968.</paragraph>
115cdf0e10cSrcweir</section>
116cdf0e10cSrcweir<section id="daysinmonth">
11788cae784Smseidel<bookmark xml-lang="en-US" branch="index" id="bm_id3154737">
11888cae784Smseidel<bookmark_value>DAYSINMONTH function</bookmark_value>
119cdf0e10cSrcweir<bookmark_value>number of days;in a specific month of a year</bookmark_value>
120cdf0e10cSrcweir</bookmark><comment>mw added one entry</comment>
121cdf0e10cSrcweir<bookmark xml-lang="en-US" branch="hid/SC_HID_DAI_FUNC_DAYSINMONTH" id="bm_id3155593" localize="false"/>
122*d5240548Smseidel<paragraph role="heading" id="hd_id3154737" xml-lang="en-US" level="2" l10n="U">DAYSINMONTH</paragraph>
123*d5240548Smseidel<paragraph role="paragraph" id="par_id3149316" xml-lang="en-US" l10n="CHG"><ahelp hid="HID_DAI_FUNC_DAYSINMONTH">Calculates the number of days of the month in which the date entered occurs.</ahelp></paragraph>
124*d5240548Smseidel<paragraph role="heading" id="hd_id3145114" xml-lang="en-US" level="3" l10n="U">Syntax</paragraph>
125*d5240548Smseidel<paragraph role="code" id="par_id3150955" xml-lang="en-US" l10n="U">DAYSINMONTH(Date)</paragraph>
126*d5240548Smseidel<paragraph role="paragraph" id="par_id3147501" xml-lang="en-US" l10n="CHG"><emph>Date</emph> is any date in the respective month of the desired year. The Date parameter must be a valid date according to the locale settings of %PRODUCTNAME.</paragraph>
127*d5240548Smseidel<paragraph role="heading" id="hd_id3149871" xml-lang="en-US" level="3" l10n="U">Example</paragraph>
128*d5240548Smseidel<paragraph role="paragraph" id="par_id3155742" xml-lang="en-US" l10n="CHG">=DAYSINMONTH(A1) returns 29 days if A1 contains 1968-02-17, a valid date for February 1968.</paragraph>
129cdf0e10cSrcweir</section>
130cdf0e10cSrcweir<section id="weeks">
13188cae784Smseidel<bookmark xml-lang="en-US" branch="index" id="bm_id3149048">
13288cae784Smseidel<bookmark_value>WEEKS function</bookmark_value>
133cdf0e10cSrcweir<bookmark_value>number of weeks;between two dates</bookmark_value>
134cdf0e10cSrcweir</bookmark><comment>mw added one entry</comment>
135cdf0e10cSrcweir<bookmark xml-lang="en-US" branch="hid/SC_HID_DAI_FUNC_DIFFWEEKS" id="bm_id3150435" localize="false"/>
136*d5240548Smseidel<paragraph role="heading" id="hd_id3149048" xml-lang="en-US" level="2" l10n="U">WEEKS</paragraph>
137*d5240548Smseidel<paragraph role="paragraph" id="par_id3153340" xml-lang="en-US" l10n="U"><ahelp hid="HID_DAI_FUNC_DIFFWEEKS">Calculates the difference in weeks between two dates.</ahelp></paragraph>
138*d5240548Smseidel<paragraph role="heading" id="hd_id3150393" xml-lang="en-US" level="3" l10n="U">Syntax</paragraph>
139*d5240548Smseidel<paragraph role="code" id="par_id3147402" xml-lang="en-US" l10n="U">WEEKS(StartDate; EndDate; Type)</paragraph>
140*d5240548Smseidel<paragraph role="paragraph" id="par_id3151387" xml-lang="en-US" l10n="U"><emph>StartDate</emph> is the first date</paragraph>
141*d5240548Smseidel<paragraph role="paragraph" id="par_id3146324" xml-lang="en-US" l10n="U"><emph>EndDate</emph> is the second date</paragraph>
142*d5240548Smseidel<paragraph role="paragraph" id="par_id3166467" xml-lang="en-US" l10n="U"><emph>Type</emph> calculates the type of difference. The possible values are 0 (interval) and 1 (in numbers of weeks).</paragraph>
143cdf0e10cSrcweir</section>
144cdf0e10cSrcweir<section id="weeksinyear">
14588cae784Smseidel<bookmark xml-lang="en-US" branch="index" id="bm_id3145237">
14688cae784Smseidel<bookmark_value>WEEKSINYEAR function</bookmark_value>
147cdf0e10cSrcweir<bookmark_value>number of weeks;in a specific year</bookmark_value>
148cdf0e10cSrcweir</bookmark><comment>mw added one entry</comment>
149cdf0e10cSrcweir<bookmark xml-lang="en-US" branch="hid/SC_HID_DAI_FUNC_WEEKSINYEAR" id="bm_id3146883" localize="false"/>
150*d5240548Smseidel<paragraph role="heading" id="hd_id3145237" xml-lang="en-US" level="2" l10n="U">WEEKSINYEAR</paragraph>
151*d5240548Smseidel<paragraph role="paragraph" id="par_id3147410" xml-lang="en-US" l10n="CHG"><ahelp hid="HID_DAI_FUNC_WEEKSINYEAR">Calculates the number of weeks of the year in which the date entered occurs.</ahelp> The number of weeks is defined as follows: a week that spans two years is added to the year in which most days of that week occur.</paragraph>
152*d5240548Smseidel<paragraph role="heading" id="hd_id3149719" xml-lang="en-US" level="3" l10n="U">Syntax</paragraph>
153*d5240548Smseidel<paragraph role="code" id="par_id3145638" xml-lang="en-US" l10n="U">WEEKSINYEAR(Date)</paragraph>
154*d5240548Smseidel<paragraph role="paragraph" id="par_id3149946" xml-lang="en-US" l10n="CHG"><emph>Date</emph> is any date in the respective year. The Date parameter must be a valid date according to the locale settings of %PRODUCTNAME.</paragraph>
155*d5240548Smseidel<paragraph role="heading" id="hd_id3150037" xml-lang="en-US" level="3" l10n="U">Example</paragraph>
156*d5240548Smseidel<paragraph role="paragraph" id="par_id3147614" xml-lang="en-US" l10n="CHG">WEEKSINYEAR(A1) returns 53 if A1 contains 1970-02-17, a valid date for the year 1970.</paragraph>
157cdf0e10cSrcweir</section>
158cdf0e10cSrcweir</sort>
159*d5240548Smseidel<paragraph role="heading" id="hd_id3157901" xml-lang="en-US" level="2" l10n="U">Add-ins through %PRODUCTNAME API</paragraph>
160*d5240548Smseidel<paragraph role="paragraph" id="par_id3149351" xml-lang="en-US" l10n="U">Add-ins can also be implemented through the %PRODUCTNAME <link href="https://api.openoffice.org/">API</link>.</paragraph>
161cdf0e10cSrcweir<section id="relatedtopics">
162cdf0e10cSrcweir<embed href="text/scalc/01/04060100.xhp#drking"/>
163cdf0e10cSrcweir</section>
164cdf0e10cSrcweir</body>
165cdf0e10cSrcweir</helpdocument>
166