summaryrefslogtreecommitdiffstats
path: root/source/text/scalc/01/func_weekday.xhp
blob: 878d01ed06ff481b07e608556fe904d1a36bc008 (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
<?xml version="1.0" encoding="UTF-8"?>



<!--
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 -->


		<helpdocument version="1.0">
<meta>
<topic id="textscalc01func_weekdayxml" indexer="include" status="PUBLISH">
<title id="tit" xml-lang="en-US">WEEKDAY </title>
<filename>/text/scalc/01/func_weekday.xhp</filename>
</topic>
</meta>
<body>
<bookmark xml-lang="en-US" branch="index" id="bm_id3154925"><bookmark_value>WEEKDAY function</bookmark_value>
</bookmark>
<bookmark xml-lang="en-US" branch="hid/SC_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>
</variable></paragraph>
<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>
<paragraph role="heading" id="hd_id3147217" xml-lang="en-US" level="3" l10n="U" oldref="138">Syntax</paragraph>
<paragraph role="code" id="par_id3149033" xml-lang="en-US" l10n="U" oldref="139">WEEKDAY(Number; Type)</paragraph>
<paragraph role="paragraph" id="par_id3149046" xml-lang="en-US" l10n="U" oldref="140">
<emph>Number</emph>, as a date value, is a decimal for which the weekday is to be returned.</paragraph>
<paragraph role="paragraph" id="par_id3154394" xml-lang="en-US" l10n="U" oldref="141">
<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>
<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 <switchinline select="sys"><caseinline select="MAC"><emph>%PRODUCTNAME - Preferences</emph></caseinline><defaultinline><emph>Tools - Options</emph></defaultinline></switchinline><emph> - %PRODUCTNAME Calc - Calculate</emph>.</paragraph>
<paragraph role="heading" id="hd_id3153836" xml-lang="en-US" level="3" l10n="U" oldref="143">Examples</paragraph>
<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>
<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>
<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>
<paragraph role="paragraph" id="par_id3150575" xml-lang="en-US" l10n="CHG" oldref="147">=WEEKDAY(NOW()) returns the number of the current day.</paragraph>
<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)&lt;6;"Business day";"Weekend")</paragraph>
</body>
</helpdocument>