xref: /trunk/main/helpcontent2/source/text/scalc/01/func_yearfrac.xhp (revision 3fe80fe07dc49d76077cbcd305003388ef5bc6c0)
1cdf0e10cSrcweir<?xml version="1.0" encoding="UTF-8"?>
2cdf0e10cSrcweir
302dbb15cSAndrew Rist<!--***********************************************************
4cdf0e10cSrcweir *
502dbb15cSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
602dbb15cSAndrew Rist * or more contributor license agreements.  See the NOTICE file
702dbb15cSAndrew Rist * distributed with this work for additional information
802dbb15cSAndrew Rist * regarding copyright ownership.  The ASF licenses this file
902dbb15cSAndrew Rist * to you under the Apache License, Version 2.0 (the
1002dbb15cSAndrew Rist * "License"); you may not use this file except in compliance
1102dbb15cSAndrew Rist * with the License.  You may obtain a copy of the License at
12cdf0e10cSrcweir *
1302dbb15cSAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
14cdf0e10cSrcweir *
1502dbb15cSAndrew Rist * Unless required by applicable law or agreed to in writing,
1602dbb15cSAndrew Rist * software distributed under the License is distributed on an
1702dbb15cSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1802dbb15cSAndrew Rist * KIND, either express or implied.  See the License for the
1902dbb15cSAndrew Rist * specific language governing permissions and limitations
2002dbb15cSAndrew Rist * under the License.
21cdf0e10cSrcweir *
2202dbb15cSAndrew Rist ***********************************************************-->
2302dbb15cSAndrew Rist
24cdf0e10cSrcweir<helpdocument version="1.0">
25cdf0e10cSrcweir<meta>
26cdf0e10cSrcweir<topic id="textscalc01func_yearfracxml" indexer="include" status="PUBLISH">
27cdf0e10cSrcweir<title id="tit" xml-lang="en-US">YEARFRAC</title>
28cdf0e10cSrcweir<filename>/text/scalc/01/func_yearfrac.xhp</filename>
29cdf0e10cSrcweir</topic>
30cdf0e10cSrcweir</meta>
31cdf0e10cSrcweir<body>
3282a98929Smseidel<bookmark xml-lang="en-US" branch="index" id="bm_id3148735">
3382a98929Smseidel<bookmark_value>YEARFRAC function</bookmark_value>
34cdf0e10cSrcweir</bookmark>
359b5c5849Smseidel<bookmark xml-lang="en-US" branch="hid/SC_HID_AAI_FUNC_YEARFRAC" id="bm_id3149251" localize="false"/>
36*3fe80fe0Smseidel<paragraph role="heading" id="hd_id3148735" xml-lang="en-US" level="2" l10n="U"><variable id="yearfrac"><link href="text/scalc/01/func_yearfrac.xhp">YEARFRAC</link>
37cdf0e10cSrcweir</variable></paragraph>
38*3fe80fe0Smseidel<paragraph role="paragraph" id="par_id3150899" xml-lang="en-US" l10n="U"><ahelp hid="HID_AAI_FUNC_YEARFRAC"> The result is a number between 0 and 1, representing the fraction of a year between <emph>StartDate</emph> and <emph>EndDate</emph>.</ahelp></paragraph>
39*3fe80fe0Smseidel<paragraph role="heading" id="hd_id3155259" xml-lang="en-US" level="3" l10n="U">Syntax</paragraph>
40*3fe80fe0Smseidel<paragraph role="code" id="par_id3155823" xml-lang="en-US" l10n="U">YEARFRAC(StartDate; EndDate; Basis)</paragraph>
41*3fe80fe0Smseidel<paragraph role="paragraph" id="par_id3145144" xml-lang="en-US" l10n="U"><emph>StartDate</emph> and <emph>EndDate</emph> are two date values.</paragraph>
42cdf0e10cSrcweir<section id="basis">
43*3fe80fe0Smseidel<paragraph role="paragraph" id="par_id3149954" xml-lang="en-US" l10n="U"><emph>Basis</emph> is chosen from a list of options and indicates how the year is to be calculated.</paragraph>
44cdf0e10cSrcweir<table id="tbl_id3145590">
45cdf0e10cSrcweir<tablerow>
46cdf0e10cSrcweir<tablecell colspan="" rowspan="">
47*3fe80fe0Smseidel<paragraph role="tablehead" id="par_id3146847" xml-lang="en-US" l10n="U">Basis</paragraph>
48cdf0e10cSrcweir</tablecell>
49cdf0e10cSrcweir<tablecell colspan="" rowspan="">
50*3fe80fe0Smseidel<paragraph role="tablehead" id="par_id3155956" xml-lang="en-US" l10n="U">Calculation</paragraph>
51cdf0e10cSrcweir</tablecell>
52cdf0e10cSrcweir</tablerow>
53cdf0e10cSrcweir<tablerow>
54cdf0e10cSrcweir<tablecell colspan="" rowspan="">
55*3fe80fe0Smseidel<paragraph role="tablecontent" id="par_id3154502" xml-lang="en-US" l10n="U">0 or missing</paragraph>
56cdf0e10cSrcweir</tablecell>
57cdf0e10cSrcweir<tablecell colspan="" rowspan="">
58*3fe80fe0Smseidel<paragraph role="tablecontent" id="par_id3149877" xml-lang="en-US" l10n="U">US method (NASD), 12 months of 30 days each</paragraph>
59cdf0e10cSrcweir</tablecell>
60cdf0e10cSrcweir</tablerow>
61cdf0e10cSrcweir<tablerow>
62cdf0e10cSrcweir<tablecell colspan="" rowspan="">
63*3fe80fe0Smseidel<paragraph role="tablecontent" id="par_id3148766" xml-lang="en-US" l10n="U">1</paragraph>
64cdf0e10cSrcweir</tablecell>
65cdf0e10cSrcweir<tablecell colspan="" rowspan="">
66*3fe80fe0Smseidel<paragraph role="tablecontent" id="par_id3154326" xml-lang="en-US" l10n="U">Exact number of days in months, exact number of days in year</paragraph>
67cdf0e10cSrcweir</tablecell>
68cdf0e10cSrcweir</tablerow>
69cdf0e10cSrcweir<tablerow>
70cdf0e10cSrcweir<tablecell colspan="" rowspan="">
71*3fe80fe0Smseidel<paragraph role="tablecontent" id="par_id3145245" xml-lang="en-US" l10n="U">2</paragraph>
72cdf0e10cSrcweir</tablecell>
73cdf0e10cSrcweir<tablecell colspan="" rowspan="">
74*3fe80fe0Smseidel<paragraph role="tablecontent" id="par_id3155620" xml-lang="en-US" l10n="U">Exact number of days in month, year has 360 days</paragraph>
75cdf0e10cSrcweir</tablecell>
76cdf0e10cSrcweir</tablerow>
77cdf0e10cSrcweir<tablerow>
78cdf0e10cSrcweir<tablecell colspan="" rowspan="">
79*3fe80fe0Smseidel<paragraph role="tablecontent" id="par_id3145297" xml-lang="en-US" l10n="U">3</paragraph>
80cdf0e10cSrcweir</tablecell>
81cdf0e10cSrcweir<tablecell colspan="" rowspan="">
82*3fe80fe0Smseidel<paragraph role="tablecontent" id="par_id3148394" xml-lang="en-US" l10n="U">Exact number of days in month, year has 365 days</paragraph>
83cdf0e10cSrcweir</tablecell>
84cdf0e10cSrcweir</tablerow>
85cdf0e10cSrcweir<tablerow>
86cdf0e10cSrcweir<tablecell colspan="" rowspan="">
87*3fe80fe0Smseidel<paragraph role="tablecontent" id="par_id3151022" xml-lang="en-US" l10n="U">4</paragraph>
88cdf0e10cSrcweir</tablecell>
89cdf0e10cSrcweir<tablecell colspan="" rowspan="">
90*3fe80fe0Smseidel<paragraph role="tablecontent" id="par_id3150931" xml-lang="en-US" l10n="U">European method, 12 months of 30 days each</paragraph>
91cdf0e10cSrcweir</tablecell>
92cdf0e10cSrcweir</tablerow>
93cdf0e10cSrcweir</table>
94cdf0e10cSrcweir</section>
95*3fe80fe0Smseidel<paragraph role="heading" id="hd_id3145626" xml-lang="en-US" level="3" l10n="U">Example</paragraph>
96*3fe80fe0Smseidel<paragraph role="paragraph" id="par_id3149007" xml-lang="en-US" l10n="CHG">What fraction of the year 2008 lies between 2008-01-01 and 2008-07-01?</paragraph>
97*3fe80fe0Smseidel<paragraph role="code" id="par_id3154632" xml-lang="en-US" l10n="CHG">=YEARFRAC("2008-01-01"; "2008-07-01";0) returns 0.50.</paragraph>
98cdf0e10cSrcweir</body>
99cdf0e10cSrcweir</helpdocument>
100