summaryrefslogtreecommitdiff
path: root/helpcontent2/source/text/scalc/01/func_yearfrac.xhp
blob: 8ac5ddc490ef187574a97757b1fa732a7a92d058 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<?xml version="1.0" encoding="UTF-8"?>



<!--
 ***********************************************************************
 *
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 * 
 * Copyright 2008 by Sun Microsystems, Inc.
 *
 * OpenOffice.org - a multi-platform office productivity suite
 *
 * $RCSfile: func_yearfrac.xhp,v $
 * $Revision: 1.9 $
 *
 * This file is part of OpenOffice.org.
 *
 * OpenOffice.org is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3
 * only, as published by the Free Software Foundation.
 *
 * OpenOffice.org is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License version 3 for more details
 * (a copy is included in the LICENSE file that accompanied this code).
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with OpenOffice.org.  If not, see
 * <http://www.openoffice.org/license.html>
 * for a copy of the LGPLv3 License.
 *
 ************************************************************************
 -->


		<helpdocument version="1.0">
<meta>
<topic id="textscalc01func_yearfracxml" indexer="include" status="PUBLISH">
<title id="tit" xml-lang="en-US">YEARFRAC</title>
<filename>/text/scalc/01/func_yearfrac.xhp</filename>
</topic>
</meta>
<body>
<bookmark xml-lang="en-US" branch="index" id="bm_id3148735"><bookmark_value>YEARFRAC function</bookmark_value>
</bookmark>
<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>
</variable></paragraph>
<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>
<paragraph role="heading" id="hd_id3155259" xml-lang="en-US" level="3" l10n="U" oldref="198">Syntax</paragraph>
<paragraph role="code" id="par_id3155823" xml-lang="en-US" l10n="U" oldref="199">YEARFRAC(StartDate; EndDate; Basis)</paragraph>
<paragraph role="paragraph" id="par_id3145144" xml-lang="en-US" l10n="U" oldref="200">
<emph>StartDate</emph> and <emph>EndDate</emph> are two date values.</paragraph>
<section id="basis">
<paragraph role="paragraph" id="par_id3149954" xml-lang="en-US" l10n="U" oldref="201">
<emph>Basis</emph> is chosen from a list of options and indicates how the year is to be calculated.</paragraph>
<table id="tbl_id3145590">
<tablerow>
<tablecell colspan="" rowspan="">
<paragraph role="tablehead" id="par_id3146847" xml-lang="en-US" l10n="U" oldref="202">Basis</paragraph>
</tablecell>
<tablecell colspan="" rowspan="">
<paragraph role="tablehead" id="par_id3155956" xml-lang="en-US" l10n="U" oldref="203">Calculation</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell colspan="" rowspan="">
<paragraph role="tablecontent" id="par_id3154502" xml-lang="en-US" l10n="U" oldref="204">0 or missing</paragraph>
</tablecell>
<tablecell colspan="" rowspan="">
<paragraph role="tablecontent" id="par_id3149877" xml-lang="en-US" l10n="U" oldref="205">US method (NASD), 12 months of 30 days each</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell colspan="" rowspan="">
<paragraph role="tablecontent" id="par_id3148766" xml-lang="en-US" l10n="U" oldref="250">1</paragraph>
</tablecell>
<tablecell colspan="" rowspan="">
<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>
</tablecell>
</tablerow>
<tablerow>
<tablecell colspan="" rowspan="">
<paragraph role="tablecontent" id="par_id3145245" xml-lang="en-US" l10n="U" oldref="251">2</paragraph>
</tablecell>
<tablecell colspan="" rowspan="">
<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>
</tablecell>
</tablerow>
<tablerow>
<tablecell colspan="" rowspan="">
<paragraph role="tablecontent" id="par_id3145297" xml-lang="en-US" l10n="U" oldref="252">3</paragraph>
</tablecell>
<tablecell colspan="" rowspan="">
<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>
</tablecell>
</tablerow>
<tablerow>
<tablecell colspan="" rowspan="">
<paragraph role="tablecontent" id="par_id3151022" xml-lang="en-US" l10n="U" oldref="253">4</paragraph>
</tablecell>
<tablecell colspan="" rowspan="">
<paragraph role="tablecontent" id="par_id3150931" xml-lang="en-US" l10n="U" oldref="209">European method, 12 months of 30 days each</paragraph>
</tablecell>
</tablerow>
</table>
</section>
<paragraph role="heading" id="hd_id3145626" xml-lang="en-US" level="3" l10n="U" oldref="210">Example</paragraph>
<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>
<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>
</body>
</helpdocument>