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