1cdf0e10cSrcweir<?xml version="1.0" encoding="UTF-8"?>
2cdf0e10cSrcweir
352ac0773SAndrew Rist<!--***********************************************************
40ac5863eSmseidel *
552ac0773SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
652ac0773SAndrew Rist * or more contributor license agreements.  See the NOTICE file
752ac0773SAndrew Rist * distributed with this work for additional information
852ac0773SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
952ac0773SAndrew Rist * to you under the Apache License, Version 2.0 (the
1052ac0773SAndrew Rist * "License"); you may not use this file except in compliance
1152ac0773SAndrew Rist * with the License.  You may obtain a copy of the License at
120ac5863eSmseidel *
1352ac0773SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
140ac5863eSmseidel *
1552ac0773SAndrew Rist * Unless required by applicable law or agreed to in writing,
1652ac0773SAndrew Rist * software distributed under the License is distributed on an
1752ac0773SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1852ac0773SAndrew Rist * KIND, either express or implied.  See the License for the
1952ac0773SAndrew Rist * specific language governing permissions and limitations
2052ac0773SAndrew Rist * under the License.
210ac5863eSmseidel *
2252ac0773SAndrew Rist ***********************************************************-->
2352ac0773SAndrew Rist
240ac5863eSmseidel<helpdocument version="1.0">
25cdf0e10cSrcweir<meta>
26cdf0e10cSrcweir<topic id="textscalc01func_weekdayxml" indexer="include" status="PUBLISH">
270ac5863eSmseidel<title id="tit" xml-lang="en-US">WEEKDAY</title>
28cdf0e10cSrcweir<filename>/text/scalc/01/func_weekday.xhp</filename>
29cdf0e10cSrcweir</topic>
30cdf0e10cSrcweir</meta>
31cdf0e10cSrcweir<body>
3272c4b3b3Smseidel<bookmark xml-lang="en-US" branch="index" id="bm_id3154925">
3372c4b3b3Smseidel<bookmark_value>WEEKDAY function</bookmark_value>
34cdf0e10cSrcweir</bookmark>
35d0ab5cd3Smseidel<bookmark xml-lang="en-US" branch="hid/SC_HID_FUNC_WOCHENTAG" id="bm_id3152359" localize="false"/>
36*10b94d00Smseidel<paragraph role="heading" id="hd_id3154925" xml-lang="en-US" level="2" l10n="U"><variable id="weekday"><link href="text/scalc/01/func_weekday.xhp">WEEKDAY</link>
37cdf0e10cSrcweir</variable></paragraph>
38*10b94d00Smseidel<paragraph role="paragraph" id="par_id3154228" xml-lang="en-US" l10n="U"><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>
39*10b94d00Smseidel<paragraph role="heading" id="hd_id3147217" xml-lang="en-US" level="3" l10n="U">Syntax</paragraph>
40*10b94d00Smseidel<paragraph role="code" id="par_id3149033" xml-lang="en-US" l10n="U">WEEKDAY(Number; Type)</paragraph>
41*10b94d00Smseidel<paragraph role="paragraph" id="par_id3149046" xml-lang="en-US" l10n="U"><emph>Number</emph>, as a date value, is a decimal for which the weekday is to be returned.</paragraph>
42*10b94d00Smseidel<paragraph role="paragraph" id="par_id3154394" xml-lang="en-US" l10n="U"><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>
43*10b94d00Smseidel<paragraph role="note" id="par_id3156188" xml-lang="en-US" l10n="U">These values apply only to the standard date format that you select under <emph><switchinline select="sys"><caseinline select="MAC">%PRODUCTNAME - Preferences</caseinline><defaultinline>Tools - Options</defaultinline></switchinline> - %PRODUCTNAME Calc - Calculate</emph>.</paragraph>
44*10b94d00Smseidel<paragraph role="heading" id="hd_id3153836" xml-lang="en-US" level="3" l10n="U">Examples</paragraph>
45*10b94d00Smseidel<paragraph role="paragraph" id="par_id3150317" xml-lang="en-US" l10n="CHG">=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>
46*10b94d00Smseidel<paragraph role="paragraph" id="par_id3153174" xml-lang="en-US" l10n="CHG">=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>
47*10b94d00Smseidel<paragraph role="paragraph" id="par_id3153525" xml-lang="en-US" l10n="CHG">=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>
48*10b94d00Smseidel<paragraph role="paragraph" id="par_id3150575" xml-lang="en-US" l10n="CHG">=WEEKDAY(NOW()) returns the number of the current day.</paragraph>
49*10b94d00Smseidel<paragraph role="tip" id="par_id3150588" xml-lang="en-US" l10n="U">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>
50cdf0e10cSrcweir</body>
51cdf0e10cSrcweir</helpdocument>
52