1<?xml version="1.0" encoding="UTF-8"?> 2<helpdocument version="1.0"> 3 4<!--*********************************************************** 5 * 6 * Licensed to the Apache Software Foundation (ASF) under one 7 * or more contributor license agreements. See the NOTICE file 8 * distributed with this work for additional information 9 * regarding copyright ownership. The ASF licenses this file 10 * to you under the Apache License, Version 2.0 (the 11 * "License"); you may not use this file except in compliance 12 * with the License. You may obtain a copy of the License at 13 * 14 * http://www.apache.org/licenses/LICENSE-2.0 15 * 16 * Unless required by applicable law or agreed to in writing, 17 * software distributed under the License is distributed on an 18 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 19 * KIND, either express or implied. See the License for the 20 * specific language governing permissions and limitations 21 * under the License. 22 * 23 ***********************************************************--> 24 25 26 27 28<meta> 29<topic id="textscalc0104060111xml" indexer="include"> 30<title id="tit" xml-lang="en-US">Add-in Functions</title> 31<filename>/text/scalc/01/04060111.xhp</filename> 32</topic> 33</meta> 34<body> 35<bookmark xml-lang="en-US" branch="index" id="bm_id3150870"><bookmark_value>add-ins; functions</bookmark_value> 36<bookmark_value>functions; add-in functions</bookmark_value> 37<bookmark_value>Function Wizard; add-ins</bookmark_value> 38</bookmark> 39<paragraph role="heading" id="hd_id3150870" xml-lang="en-US" level="1" l10n="U" oldref="1">Add-in Functions</paragraph> 40<paragraph role="paragraph" id="par_id3147427" xml-lang="en-US" l10n="CHG" oldref="2"><variable id="addintext">The following describes and lists some of the available add-in functions. 41</variable></paragraph> 42<paragraph role="paragraph" id="par_id3163713" xml-lang="en-US" l10n="U" oldref="75"><link href="text/scalc/01/04060112.xhp#addinconcept">Add-in concept</link></paragraph> 43<paragraph role="paragraph" id="par_id3146120" xml-lang="en-US" l10n="U" oldref="5">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 44</caseinline><defaultinline>$[officename] Calc add-in DLL</defaultinline></switchinline>.</paragraph> 45<paragraph role="heading" id="hd_id3151075" xml-lang="en-US" level="2" l10n="U" oldref="7">Add-ins supplied</paragraph> 46<paragraph role="paragraph" id="par_id3156285" xml-lang="en-US" l10n="CHG" oldref="8">$[officename] contains examples for the add-in interface of $[officename] Calc.</paragraph> 47<paragraph role="paragraph" id="par_id3159267" xml-lang="en-US" l10n="U" oldref="76"><link href="text/scalc/01/04060115.xhp">Analysis Functions Part One</link></paragraph> 48<paragraph role="paragraph" id="par_id3154703" xml-lang="en-US" l10n="U" oldref="77"><link href="text/scalc/01/04060116.xhp">Analysis Functions Part Two</link></paragraph> 49<sort order="asc"> 50<section id="isleapyear"> 51<bookmark xml-lang="en-US" branch="index" id="bm_id3149566"><bookmark_value>ISLEAPYEAR function</bookmark_value> 52<bookmark_value>leap year determination</bookmark_value> 53</bookmark><comment>mw added one entry</comment> 54<paragraph role="heading" id="hd_id3149566" xml-lang="en-US" level="2" l10n="U" oldref="14">ISLEAPYEAR</paragraph> 55<paragraph role="paragraph" id="par_id3150297" xml-lang="en-US" l10n="U" oldref="15"><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> 56<paragraph role="heading" id="hd_id3148487" xml-lang="en-US" level="3" l10n="U" oldref="16">Syntax</paragraph> 57<paragraph role="code" id="par_id3150205" xml-lang="en-US" l10n="U" oldref="17">ISLEAPYEAR("Date")</paragraph> 58<paragraph role="paragraph" id="par_id3159239" xml-lang="en-US" l10n="U" oldref="18"> 59<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> 60<paragraph role="heading" id="hd_id3149817" xml-lang="en-US" level="3" l10n="U" oldref="19">Example</paragraph> 61<paragraph role="paragraph" id="par_id3150786" xml-lang="en-US" l10n="CHG" oldref="20">=ISLEAPYEAR(A1) returns 1, if A1 contains 1968-02-29, the valid date 29th of February 1968 in your locale setting.</paragraph> 62<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> 63<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> 64</section> 65<section id="years"> 66<bookmark xml-lang="en-US" branch="index" id="bm_id3154656"><bookmark_value>YEARS function</bookmark_value> 67<bookmark_value>number of years between two dates</bookmark_value> 68</bookmark><comment>mw added one entry</comment> 69<bookmark xml-lang="en-US" branch="hid/SC_HID_DAI_FUNC_DIFFYEARS" id="bm_id3150368" localize="false"/> 70<paragraph role="heading" id="hd_id3154656" xml-lang="en-US" level="2" l10n="U" oldref="21">YEARS</paragraph> 71<paragraph role="paragraph" id="par_id3150886" xml-lang="en-US" l10n="U" oldref="22"><ahelp hid="HID_DAI_FUNC_DIFFYEARS">Calculates the difference in years between two dates.</ahelp></paragraph> 72<paragraph role="heading" id="hd_id3154370" xml-lang="en-US" level="3" l10n="U" oldref="23">Syntax</paragraph> 73<paragraph role="code" id="par_id3146114" xml-lang="en-US" l10n="U" oldref="24">YEARS(StartDate; EndDate; Type)</paragraph> 74<paragraph role="paragraph" id="par_id3145387" xml-lang="en-US" l10n="U" oldref="25"> 75<emph>StartDate</emph> is the first date</paragraph> 76<paragraph role="paragraph" id="par_id3156290" xml-lang="en-US" l10n="U" oldref="26"> 77<emph>EndDate</emph> is the second date</paragraph> 78<paragraph role="paragraph" id="par_id3152893" xml-lang="en-US" l10n="U" oldref="27"> 79<emph>Type</emph> calculates the type of difference. Possible values are 0 (interval) and 1 (in calendar years).</paragraph> 80</section> 81<section id="months"> 82<bookmark xml-lang="en-US" branch="index" id="bm_id3152898"><bookmark_value>MONTHS function</bookmark_value> 83<bookmark_value>number of months between two dates</bookmark_value> 84</bookmark><comment>mw added one entry</comment> 85<bookmark xml-lang="en-US" branch="hid/SC_HID_DAI_FUNC_DIFFMONTHS" id="bm_id3148839" localize="false"/> 86<paragraph role="heading" id="hd_id3152898" xml-lang="en-US" level="2" l10n="U" oldref="28">MONTHS</paragraph> 87<paragraph role="paragraph" id="par_id3153066" xml-lang="en-US" l10n="U" oldref="29"><ahelp hid="HID_DAI_FUNC_DIFFMONTHS">Calculates the difference in months between two dates.</ahelp></paragraph> 88<paragraph role="heading" id="hd_id3151240" xml-lang="en-US" level="3" l10n="U" oldref="30">Syntax</paragraph> 89<paragraph role="code" id="par_id3146869" xml-lang="en-US" l10n="U" oldref="31">MONTHS(StartDate; EndDate; Type)</paragraph> 90<paragraph role="paragraph" id="par_id3145075" xml-lang="en-US" l10n="U" oldref="32"> 91<emph>StartDate</emph> is the first date</paragraph> 92<paragraph role="paragraph" id="par_id3157981" xml-lang="en-US" l10n="U" oldref="33"> 93<emph>EndDate</emph> is the second date</paragraph> 94<paragraph role="paragraph" id="par_id3150111" xml-lang="en-US" l10n="U" oldref="34"> 95<emph>Type</emph> calculates the type of difference. Possible values include 0 (interval) and 1 (in calendar months).</paragraph> 96</section> 97<section id="rot13"> 98<bookmark xml-lang="en-US" branch="index" id="bm_id3159094"><bookmark_value>ROT13 function</bookmark_value> 99<bookmark_value>encrypting text</bookmark_value> 100</bookmark><comment>mw added one entry</comment> 101<bookmark xml-lang="en-US" branch="hid/SC_HID_DAI_FUNC_ROT13" id="bm_id3153283" localize="false"/> 102<paragraph role="heading" id="hd_id3159094" xml-lang="en-US" level="2" l10n="U" oldref="35">ROT13</paragraph> 103<paragraph role="paragraph" id="par_id3146781" xml-lang="en-US" l10n="U" oldref="36"><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> 104<paragraph role="heading" id="hd_id3150893" xml-lang="en-US" level="3" l10n="U" oldref="37">Syntax</paragraph> 105<paragraph role="code" id="par_id3159205" xml-lang="en-US" l10n="U" oldref="38">ROT13(Text)</paragraph> 106<paragraph role="paragraph" id="par_id3153249" xml-lang="en-US" l10n="U" oldref="39"> 107<emph>Text</emph> is the character string to be encrypted. ROT13(ROT13(Text)) decrypts the code.</paragraph> 108</section> 109<section id="daysinyear"> 110<bookmark xml-lang="en-US" branch="index" id="bm_id3151300"><bookmark_value>DAYSINYEAR function</bookmark_value> 111<bookmark_value>number of days; in a specific year</bookmark_value> 112</bookmark><comment>mw added one entry</comment> 113<bookmark xml-lang="en-US" branch="hid/SC_HID_DAI_FUNC_DAYSINYEAR" id="bm_id3153972" localize="false"/> 114<paragraph role="heading" id="hd_id3151300" xml-lang="en-US" level="2" l10n="U" oldref="43">DAYSINYEAR</paragraph> 115<paragraph role="paragraph" id="par_id3143220" xml-lang="en-US" l10n="CHG" oldref="44"><ahelp hid="HID_DAI_FUNC_DAYSINYEAR">Calculates the number of days of the year in which the date entered occurs.</ahelp></paragraph> 116<paragraph role="heading" id="hd_id3145358" xml-lang="en-US" level="3" l10n="U" oldref="45">Syntax</paragraph> 117<paragraph role="code" id="par_id3154651" xml-lang="en-US" l10n="U" oldref="46">DAYSINYEAR(Date)</paragraph> 118<paragraph role="paragraph" id="par_id3153803" xml-lang="en-US" l10n="CHG" oldref="47"> 119<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> 120<paragraph role="heading" id="hd_id3153487" xml-lang="en-US" level="3" l10n="U" oldref="48">Example</paragraph> 121<paragraph role="paragraph" id="par_id3153811" xml-lang="en-US" l10n="CHG" oldref="49">=DAYSINYEAR(A1) returns 366 days if A1 contains 1968-02-29, a valid date for the year 1968.</paragraph> 122</section> 123<section id="daysinmonth"> 124<bookmark xml-lang="en-US" branch="index" id="bm_id3154737"><bookmark_value>DAYSINMONTH function</bookmark_value> 125<bookmark_value>number of days;in a specific month of a year</bookmark_value> 126</bookmark><comment>mw added one entry</comment> 127<bookmark xml-lang="en-US" branch="hid/SC_HID_DAI_FUNC_DAYSINMONTH" id="bm_id3155593" localize="false"/> 128<paragraph role="heading" id="hd_id3154737" xml-lang="en-US" level="2" l10n="U" oldref="50">DAYSINMONTH</paragraph> 129<paragraph role="paragraph" id="par_id3149316" xml-lang="en-US" l10n="CHG" oldref="51"><ahelp hid="HID_DAI_FUNC_DAYSINMONTH">Calculates the number of days of the month in which the date entered occurs.</ahelp></paragraph> 130<paragraph role="heading" id="hd_id3145114" xml-lang="en-US" level="3" l10n="U" oldref="52">Syntax</paragraph> 131<paragraph role="code" id="par_id3150955" xml-lang="en-US" l10n="U" oldref="53">DAYSINMONTH(Date)</paragraph> 132<paragraph role="paragraph" id="par_id3147501" xml-lang="en-US" l10n="CHG" oldref="54"> 133<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> 134<paragraph role="heading" id="hd_id3149871" xml-lang="en-US" level="3" l10n="U" oldref="55">Example</paragraph> 135<paragraph role="paragraph" id="par_id3155742" xml-lang="en-US" l10n="CHG" oldref="56">=DAYSINMONTH(A1) returns 29 days if A1 contains 1968-02-17, a valid date for February 1968.</paragraph> 136</section> 137<section id="weeks"> 138<bookmark xml-lang="en-US" branch="index" id="bm_id3149048"><bookmark_value>WEEKS function</bookmark_value> 139<bookmark_value>number of weeks;between two dates</bookmark_value> 140</bookmark><comment>mw added one entry</comment> 141<bookmark xml-lang="en-US" branch="hid/SC_HID_DAI_FUNC_DIFFWEEKS" id="bm_id3150435" localize="false"/> 142<paragraph role="heading" id="hd_id3149048" xml-lang="en-US" level="2" l10n="U" oldref="57">WEEKS</paragraph> 143<paragraph role="paragraph" id="par_id3153340" xml-lang="en-US" l10n="U" oldref="58"><ahelp hid="HID_DAI_FUNC_DIFFWEEKS">Calculates the difference in weeks between two dates.</ahelp></paragraph> 144<paragraph role="heading" id="hd_id3150393" xml-lang="en-US" level="3" l10n="U" oldref="59">Syntax</paragraph> 145<paragraph role="code" id="par_id3147402" xml-lang="en-US" l10n="U" oldref="60">WEEKS(StartDate; EndDate; Type)</paragraph> 146<paragraph role="paragraph" id="par_id3151387" xml-lang="en-US" l10n="U" oldref="61"> 147<emph>StartDate</emph> is the first date</paragraph> 148<paragraph role="paragraph" id="par_id3146324" xml-lang="en-US" l10n="U" oldref="62"> 149<emph>EndDate</emph> is the second date</paragraph> 150<paragraph role="paragraph" id="par_id3166467" xml-lang="en-US" l10n="U" oldref="63"> 151<emph>Type</emph> calculates the type of difference. The possible values are 0 (interval) and 1 (in numbers of weeks).</paragraph> 152</section> 153<section id="weeksinyear"> 154<bookmark xml-lang="en-US" branch="index" id="bm_id3145237"><bookmark_value>WEEKSINYEAR function</bookmark_value> 155<bookmark_value>number of weeks;in a specific year</bookmark_value> 156</bookmark><comment>mw added one entry</comment> 157<bookmark xml-lang="en-US" branch="hid/SC_HID_DAI_FUNC_WEEKSINYEAR" id="bm_id3146883" localize="false"/> 158<paragraph role="heading" id="hd_id3145237" xml-lang="en-US" level="2" l10n="U" oldref="64">WEEKSINYEAR</paragraph> 159<paragraph role="paragraph" id="par_id3147410" xml-lang="en-US" l10n="CHG" oldref="65"><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> 160<paragraph role="heading" id="hd_id3149719" xml-lang="en-US" level="3" l10n="U" oldref="66">Syntax</paragraph> 161<paragraph role="code" id="par_id3145638" xml-lang="en-US" l10n="U" oldref="67">WEEKSINYEAR(Date)</paragraph> 162<paragraph role="paragraph" id="par_id3149946" xml-lang="en-US" l10n="CHG" oldref="68"> 163<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> 164<paragraph role="heading" id="hd_id3150037" xml-lang="en-US" level="3" l10n="U" oldref="69">Example</paragraph> 165<paragraph role="paragraph" id="par_id3147614" xml-lang="en-US" l10n="CHG" oldref="70">WEEKSINYEAR(A1) returns 53 if A1 contains 1970-02-17, a valid date for the year 1970.</paragraph> 166</section> 167</sort> 168<paragraph role="heading" id="hd_id3157901" xml-lang="en-US" level="2" l10n="U" oldref="72">Add-ins through %PRODUCTNAME API</paragraph> 169<paragraph role="paragraph" id="par_id3149351" xml-lang="en-US" l10n="U" oldref="73">Add-ins can also be implemented through the %PRODUCTNAME <link href="https://api.openoffice.org/">API</link>.</paragraph> 170<section id="relatedtopics"> 171<embed href="text/scalc/01/04060100.xhp#drking"/> 172</section> 173</body> 174</helpdocument> 175