1 <?xml version=
"1.0" encoding=
"UTF-8"?>
6 ***********************************************************************
8 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
10 * Copyright 2008 by Sun Microsystems, Inc.
12 * OpenOffice.org - a multi-platform office productivity suite
14 * $RCSfile: func_weekday.xhp,v $
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 ************************************************************************
38 <helpdocument version=
"1.0">
40 <topic id=
"textscalc01func_weekdayxml" indexer=
"include" status=
"PUBLISH">
41 <title id=
"tit" xml-lang=
"en-US">WEEKDAY
</title>
42 <filename>/text/scalc/
01/func_weekday.xhp
</filename>
46 <bookmark xml-lang=
"en-US" branch=
"index" id=
"bm_id3154925"><bookmark_value>WEEKDAY function
</bookmark_value>
48 <bookmark xml-lang=
"en-US" branch=
"hid/HID_FUNC_WOCHENTAG" id=
"bm_id3152359" localize=
"false"/><paragraph role=
"heading" id=
"hd_id3154925" xml-lang=
"en-US" level=
"2" l10n=
"U" oldref=
"136"><variable id=
"weekday"><link href=
"text/scalc/01/func_weekday.xhp">WEEKDAY
</link>
49 </variable></paragraph>
50 <paragraph role=
"paragraph" id=
"par_id3154228" xml-lang=
"en-US" l10n=
"U" oldref=
"137"><ahelp hid=
"HID_FUNC_WOCHENTAG">Returns the day of the week for the given date value.
</ahelp> The day is returned as an integer between
1 (Sunday) and
7 (Saturday) if no type or type=
1 is specified. If type=
2, numbering begins at Monday=
1; and if type=
3 numbering begins at Monday=
0.
</paragraph>
51 <paragraph role=
"heading" id=
"hd_id3147217" xml-lang=
"en-US" level=
"3" l10n=
"U" oldref=
"138">Syntax
</paragraph>
52 <paragraph role=
"code" id=
"par_id3149033" xml-lang=
"en-US" l10n=
"U" oldref=
"139">WEEKDAY(Number; Type)
</paragraph>
53 <paragraph role=
"paragraph" id=
"par_id3149046" xml-lang=
"en-US" l10n=
"U" oldref=
"140">
54 <emph>Number
</emph>, as a date value, is a decimal for which the weekday is to be returned.
</paragraph>
55 <paragraph role=
"paragraph" id=
"par_id3154394" xml-lang=
"en-US" l10n=
"U" oldref=
"141">
56 <emph>Type
</emph> determines the type of calculation. For Type=
1, the weekdays are counted starting from Sunday (this is the default even when the Type parameter is missing). For Type=
2, the weekdays are counted starting from Monday=
1. For Type=
3, the weekdays are counted starting from Monday=
0.
</paragraph>
57 <paragraph role=
"note" id=
"par_id3156188" xml-lang=
"en-US" l10n=
"U" oldref=
"142">These values apply only to the standard date format that you select under
<emph>Tools - Options - %PRODUCTNAME Calc - Calculate
</emph>.
</paragraph>
58 <paragraph role=
"heading" id=
"hd_id3153836" xml-lang=
"en-US" level=
"3" l10n=
"U" oldref=
"143">Examples
</paragraph>
59 <paragraph role=
"paragraph" id=
"par_id3150317" xml-lang=
"en-US" l10n=
"CHG" oldref=
"144">=WEEKDAY(
"2000-06-14") returns
4 (the Type parameter is missing, therefore the standard count is used. The standard count starts with Sunday as day number
1. June
14,
2000 was a Wednesday and therefore day number
4).
</paragraph>
60 <paragraph role=
"paragraph" id=
"par_id3153174" xml-lang=
"en-US" l10n=
"CHG" oldref=
"145">=WEEKDAY(
"1996-07-24";
2) returns
3 (the Type parameter is
2, therefore Monday is day number
1. July
24,
1996 was a Wednesday and therefore day number
3).
</paragraph>
61 <paragraph role=
"paragraph" id=
"par_id3153525" xml-lang=
"en-US" l10n=
"CHG" oldref=
"146">=WEEKDAY(
"1996-07-24";
1) returns
4 (the Type parameter is
1, therefore Sunday is day number
1. July
24,
1996 was a Wednesday and therefore day number
4).
</paragraph>
62 <paragraph role=
"paragraph" id=
"par_id3150575" xml-lang=
"en-US" l10n=
"CHG" oldref=
"147">=WEEKDAY(NOW()) returns the number of the current day.
</paragraph>
63 <paragraph role=
"tip" id=
"par_id3150588" xml-lang=
"en-US" l10n=
"U" oldref=
"171">To obtain a function indicating whether a day in A1 is a business day, use the IF and WEEKDAY functions as follows:
<br/>IF(WEEKDAY(A1;
2)
<6;
"Business day";
"Weekend")
</paragraph>