Update ooo320-m1
[ooovba.git] / helpcontent2 / source / text / scalc / 01 / func_yearfrac.xhp
blob8ac5ddc490ef187574a97757b1fa732a7a92d058
1 <?xml version="1.0" encoding="UTF-8"?>
5 <!--
6 ***********************************************************************
8 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9 *
10 * Copyright 2008 by Sun Microsystems, Inc.
12 * OpenOffice.org - a multi-platform office productivity suite
14 * $RCSfile: func_yearfrac.xhp,v $
15 * $Revision: 1.9 $
17 * This file is part of OpenOffice.org.
19 * OpenOffice.org is free software: you can redistribute it and/or modify
20 * it under the terms of the GNU Lesser General Public License version 3
21 * only, as published by the Free Software Foundation.
23 * OpenOffice.org is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU Lesser General Public License version 3 for more details
27 * (a copy is included in the LICENSE file that accompanied this code).
29 * You should have received a copy of the GNU Lesser General Public License
30 * version 3 along with OpenOffice.org. If not, see
31 * <http://www.openoffice.org/license.html>
32 * for a copy of the LGPLv3 License.
34 ************************************************************************
35 -->
38 <helpdocument version="1.0">
39 <meta>
40 <topic id="textscalc01func_yearfracxml" indexer="include" status="PUBLISH">
41 <title id="tit" xml-lang="en-US">YEARFRAC</title>
42 <filename>/text/scalc/01/func_yearfrac.xhp</filename>
43 </topic>
44 </meta>
45 <body>
46 <bookmark xml-lang="en-US" branch="index" id="bm_id3148735"><bookmark_value>YEARFRAC function</bookmark_value>
47 </bookmark>
48 <bookmark xml-lang="en-US" branch="hid/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>
49 </variable></paragraph>
50 <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>
51 <paragraph role="heading" id="hd_id3155259" xml-lang="en-US" level="3" l10n="U" oldref="198">Syntax</paragraph>
52 <paragraph role="code" id="par_id3155823" xml-lang="en-US" l10n="U" oldref="199">YEARFRAC(StartDate; EndDate; Basis)</paragraph>
53 <paragraph role="paragraph" id="par_id3145144" xml-lang="en-US" l10n="U" oldref="200">
54 <emph>StartDate</emph> and <emph>EndDate</emph> are two date values.</paragraph>
55 <section id="basis">
56 <paragraph role="paragraph" id="par_id3149954" xml-lang="en-US" l10n="U" oldref="201">
57 <emph>Basis</emph> is chosen from a list of options and indicates how the year is to be calculated.</paragraph>
58 <table id="tbl_id3145590">
59 <tablerow>
60 <tablecell colspan="" rowspan="">
61 <paragraph role="tablehead" id="par_id3146847" xml-lang="en-US" l10n="U" oldref="202">Basis</paragraph>
62 </tablecell>
63 <tablecell colspan="" rowspan="">
64 <paragraph role="tablehead" id="par_id3155956" xml-lang="en-US" l10n="U" oldref="203">Calculation</paragraph>
65 </tablecell>
66 </tablerow>
67 <tablerow>
68 <tablecell colspan="" rowspan="">
69 <paragraph role="tablecontent" id="par_id3154502" xml-lang="en-US" l10n="U" oldref="204">0 or missing</paragraph>
70 </tablecell>
71 <tablecell colspan="" rowspan="">
72 <paragraph role="tablecontent" id="par_id3149877" xml-lang="en-US" l10n="U" oldref="205">US method (NASD), 12 months of 30 days each</paragraph>
73 </tablecell>
74 </tablerow>
75 <tablerow>
76 <tablecell colspan="" rowspan="">
77 <paragraph role="tablecontent" id="par_id3148766" xml-lang="en-US" l10n="U" oldref="250">1</paragraph>
78 </tablecell>
79 <tablecell colspan="" rowspan="">
80 <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>
81 </tablecell>
82 </tablerow>
83 <tablerow>
84 <tablecell colspan="" rowspan="">
85 <paragraph role="tablecontent" id="par_id3145245" xml-lang="en-US" l10n="U" oldref="251">2</paragraph>
86 </tablecell>
87 <tablecell colspan="" rowspan="">
88 <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>
89 </tablecell>
90 </tablerow>
91 <tablerow>
92 <tablecell colspan="" rowspan="">
93 <paragraph role="tablecontent" id="par_id3145297" xml-lang="en-US" l10n="U" oldref="252">3</paragraph>
94 </tablecell>
95 <tablecell colspan="" rowspan="">
96 <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>
97 </tablecell>
98 </tablerow>
99 <tablerow>
100 <tablecell colspan="" rowspan="">
101 <paragraph role="tablecontent" id="par_id3151022" xml-lang="en-US" l10n="U" oldref="253">4</paragraph>
102 </tablecell>
103 <tablecell colspan="" rowspan="">
104 <paragraph role="tablecontent" id="par_id3150931" xml-lang="en-US" l10n="U" oldref="209">European method, 12 months of 30 days each</paragraph>
105 </tablecell>
106 </tablerow>
107 </table>
108 </section>
109 <paragraph role="heading" id="hd_id3145626" xml-lang="en-US" level="3" l10n="U" oldref="210">Example</paragraph>
110 <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>
111 <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>
112 </body>
113 </helpdocument>