Description
Use this function to determine the day of the week for that a date will fall on. Supported in Chains.
This returns an integer between 1 and 7 inclusive.
語法
WEEKDAY(serial_number,[return_type])
Inputs
This function has the following arguments:
名稱 | 必要 | Valid input |
---|---|---|
serial_number |
是 | A sequential number that represents the date of the day you are trying to find. Dates should be entered by using the DATE function, or as results of other formulas or functions. For example, use DATE(2024,6,23) for the 23rd day of May, 2008. Problems can occur if dates are entered as text. |
return_type |
沒有 | An integer that determines the type of return value. This can be a fixed number, a cell reference, or the product of a formula. |
範例
Return type
The WEEKDAY function allows you to specify what coding is to be used to determine the returned value.
Return_type value | Number returned |
---|---|
1 (default) | 1 = Sunday through 7 = Saturday. Behaves like previous versions of Microsoft Excel. |
2 | 1 = Monday through 7 = Sunday. |
3 | 0 = Monday through 6 = Sunday. |
11 | 1 = Monday through 7 = Sunday. |
12 | 1 = Tuesday through 7 = Monday. |
13 | 1 = Wednesday through 7 = Tuesday. |
14 | 1 = Thursday through 7 = Wednesday. |
15 | 1 = Friday through 7 = Thursday. |
16 | 1 = Saturday through 7 = Friday. |
17 | 1 = Sunday through 7 =Saturday. |
The second way to configure weekends is to provide a 7 character text string enclosed in quotation marks composed of 1s and 0s, where "1" indicates a non-work day and "0" indicates a work day. The first position represents Monday.
範例資料
A | B (return_value) |
---|---|
3/21/2022 | 1 |
9/14/2019 | 2 |
5/7/2025 | 3 |
11/30/2017 | 11 |
3/21/2022 |
Sample formulas
公式 | 說明 | 結果 |
---|---|---|
=WEEKDAY(A1) |
Returns the day of the week using the default return type. | 2 (Monday) |
=WEEKDAY(A1,3) |
Returns the day of the week using return type 3. |
0 (Monday) |
=WEEKDAY(A5,B5) |
Returns the day of the week using the default return type, as B5 is blank. |
2 (Monday) |
=WEEKDAY(A4,B4) |
Returns the day of the week using the value of cell B4 (return type 3) |
4 (Thurs) |
附註
- The WEEKDAY function will return a value even when the date is empty. Take care to trap this result if blank dates are possible.
- The Workiva platform stores dates as sequential serial numbers so they can be used in calculations. By default, January 1, 1900 = 1.
- If
serial_number
is out of range, a #NUM! error is returned. - If the
return_type
value isn;t in the set specified above, a #NUM! error is returned. - Wildcards don't work with this function.
Related functions
DATE
DATEVALUE
DAY
DAYS
DAYS360
EDATE
EOMONTH
MONTH
NETWORKDAYS
NETWORKDAYS.INTL
WEEKDAY
WORKDAY
WORKDAY.INTL
YEAR
YEARFRAC