1cdf0e10cSrcweir<?xml version="1.0" encoding="UTF-8"?>
2cdf0e10cSrcweir
3cdf0e10cSrcweir
4cdf0e10cSrcweir
5*02dbb15cSAndrew Rist<!--***********************************************************
6cdf0e10cSrcweir *
7*02dbb15cSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
8*02dbb15cSAndrew Rist * or more contributor license agreements.  See the NOTICE file
9*02dbb15cSAndrew Rist * distributed with this work for additional information
10*02dbb15cSAndrew Rist * regarding copyright ownership.  The ASF licenses this file
11*02dbb15cSAndrew Rist * to you under the Apache License, Version 2.0 (the
12*02dbb15cSAndrew Rist * "License"); you may not use this file except in compliance
13*02dbb15cSAndrew Rist * with the License.  You may obtain a copy of the License at
14*02dbb15cSAndrew Rist *
15*02dbb15cSAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
16*02dbb15cSAndrew Rist *
17*02dbb15cSAndrew Rist * Unless required by applicable law or agreed to in writing,
18*02dbb15cSAndrew Rist * software distributed under the License is distributed on an
19*02dbb15cSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
20*02dbb15cSAndrew Rist * KIND, either express or implied.  See the License for the
21*02dbb15cSAndrew Rist * specific language governing permissions and limitations
22*02dbb15cSAndrew Rist * under the License.
23*02dbb15cSAndrew Rist *
24*02dbb15cSAndrew Rist ***********************************************************-->
25*02dbb15cSAndrew Rist
26*02dbb15cSAndrew Rist
27cdf0e10cSrcweir
28cdf0e10cSrcweir
29cdf0e10cSrcweir		<helpdocument version="1.0">
30cdf0e10cSrcweir<meta>
31cdf0e10cSrcweir<topic id="textscalc01func_yearfracxml" indexer="include" status="PUBLISH">
32cdf0e10cSrcweir<title id="tit" xml-lang="en-US">YEARFRAC</title>
33cdf0e10cSrcweir<filename>/text/scalc/01/func_yearfrac.xhp</filename>
34cdf0e10cSrcweir</topic>
35cdf0e10cSrcweir</meta>
36cdf0e10cSrcweir<body>
37cdf0e10cSrcweir<bookmark xml-lang="en-US" branch="index" id="bm_id3148735"><bookmark_value>YEARFRAC function</bookmark_value>
38cdf0e10cSrcweir</bookmark>
39cdf0e10cSrcweir<bookmark xml-lang="en-US" branch="hid/SC_HID_AAI_FUNC_YEARFRAC" id="bm_id3149251" localize="false"/><paragraph role="heading" id="hd_id3148735" xml-lang="en-US" level="2" l10n="U" oldref="196"><variable id="yearfrac"><link href="text/scalc/01/func_yearfrac.xhp">YEARFRAC</link>
40cdf0e10cSrcweir</variable></paragraph>
41cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3150899" xml-lang="en-US" l10n="U" oldref="197"><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>
42cdf0e10cSrcweir<paragraph role="heading" id="hd_id3155259" xml-lang="en-US" level="3" l10n="U" oldref="198">Syntax</paragraph>
43cdf0e10cSrcweir<paragraph role="code" id="par_id3155823" xml-lang="en-US" l10n="U" oldref="199">YEARFRAC(StartDate; EndDate; Basis)</paragraph>
44cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3145144" xml-lang="en-US" l10n="U" oldref="200">
45cdf0e10cSrcweir<emph>StartDate</emph> and <emph>EndDate</emph> are two date values.</paragraph>
46cdf0e10cSrcweir<section id="basis">
47cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3149954" xml-lang="en-US" l10n="U" oldref="201">
48cdf0e10cSrcweir<emph>Basis</emph> is chosen from a list of options and indicates how the year is to be calculated.</paragraph>
49cdf0e10cSrcweir<table id="tbl_id3145590">
50cdf0e10cSrcweir<tablerow>
51cdf0e10cSrcweir<tablecell colspan="" rowspan="">
52cdf0e10cSrcweir<paragraph role="tablehead" id="par_id3146847" xml-lang="en-US" l10n="U" oldref="202">Basis</paragraph>
53cdf0e10cSrcweir</tablecell>
54cdf0e10cSrcweir<tablecell colspan="" rowspan="">
55cdf0e10cSrcweir<paragraph role="tablehead" id="par_id3155956" xml-lang="en-US" l10n="U" oldref="203">Calculation</paragraph>
56cdf0e10cSrcweir</tablecell>
57cdf0e10cSrcweir</tablerow>
58cdf0e10cSrcweir<tablerow>
59cdf0e10cSrcweir<tablecell colspan="" rowspan="">
60cdf0e10cSrcweir<paragraph role="tablecontent" id="par_id3154502" xml-lang="en-US" l10n="U" oldref="204">0 or missing</paragraph>
61cdf0e10cSrcweir</tablecell>
62cdf0e10cSrcweir<tablecell colspan="" rowspan="">
63cdf0e10cSrcweir<paragraph role="tablecontent" id="par_id3149877" xml-lang="en-US" l10n="U" oldref="205">US method (NASD), 12 months of 30 days each</paragraph>
64cdf0e10cSrcweir</tablecell>
65cdf0e10cSrcweir</tablerow>
66cdf0e10cSrcweir<tablerow>
67cdf0e10cSrcweir<tablecell colspan="" rowspan="">
68cdf0e10cSrcweir<paragraph role="tablecontent" id="par_id3148766" xml-lang="en-US" l10n="U" oldref="250">1</paragraph>
69cdf0e10cSrcweir</tablecell>
70cdf0e10cSrcweir<tablecell colspan="" rowspan="">
71cdf0e10cSrcweir<paragraph role="tablecontent" id="par_id3154326" xml-lang="en-US" l10n="U" oldref="206">Exact number of days in months, exact number of days in year</paragraph>
72cdf0e10cSrcweir</tablecell>
73cdf0e10cSrcweir</tablerow>
74cdf0e10cSrcweir<tablerow>
75cdf0e10cSrcweir<tablecell colspan="" rowspan="">
76cdf0e10cSrcweir<paragraph role="tablecontent" id="par_id3145245" xml-lang="en-US" l10n="U" oldref="251">2</paragraph>
77cdf0e10cSrcweir</tablecell>
78cdf0e10cSrcweir<tablecell colspan="" rowspan="">
79cdf0e10cSrcweir<paragraph role="tablecontent" id="par_id3155620" xml-lang="en-US" l10n="U" oldref="207">Exact number of days in month, year has 360 days</paragraph>
80cdf0e10cSrcweir</tablecell>
81cdf0e10cSrcweir</tablerow>
82cdf0e10cSrcweir<tablerow>
83cdf0e10cSrcweir<tablecell colspan="" rowspan="">
84cdf0e10cSrcweir<paragraph role="tablecontent" id="par_id3145297" xml-lang="en-US" l10n="U" oldref="252">3</paragraph>
85cdf0e10cSrcweir</tablecell>
86cdf0e10cSrcweir<tablecell colspan="" rowspan="">
87cdf0e10cSrcweir<paragraph role="tablecontent" id="par_id3148394" xml-lang="en-US" l10n="U" oldref="208">Exact number of days in month, year has 365 days</paragraph>
88cdf0e10cSrcweir</tablecell>
89cdf0e10cSrcweir</tablerow>
90cdf0e10cSrcweir<tablerow>
91cdf0e10cSrcweir<tablecell colspan="" rowspan="">
92cdf0e10cSrcweir<paragraph role="tablecontent" id="par_id3151022" xml-lang="en-US" l10n="U" oldref="253">4</paragraph>
93cdf0e10cSrcweir</tablecell>
94cdf0e10cSrcweir<tablecell colspan="" rowspan="">
95cdf0e10cSrcweir<paragraph role="tablecontent" id="par_id3150931" xml-lang="en-US" l10n="U" oldref="209">European method, 12 months of 30 days each</paragraph>
96cdf0e10cSrcweir</tablecell>
97cdf0e10cSrcweir</tablerow>
98cdf0e10cSrcweir</table>
99cdf0e10cSrcweir</section>
100cdf0e10cSrcweir<paragraph role="heading" id="hd_id3145626" xml-lang="en-US" level="3" l10n="U" oldref="210">Example</paragraph>
101cdf0e10cSrcweir<paragraph role="paragraph" id="par_id3149007" xml-lang="en-US" l10n="CHG" oldref="211">What fraction of the year 2008 lies between 2008-01-01 and 2008-07-01?</paragraph>
102cdf0e10cSrcweir<paragraph role="code" id="par_id3154632" xml-lang="en-US" l10n="CHG" oldref="212">=YEARFRAC("2008-01-01"; "2008-07-01";0) returns 0.50.</paragraph>
103cdf0e10cSrcweir</body>
104cdf0e10cSrcweir</helpdocument>
105