Returns the day of week of a date, an integer between 1 and 7.
Syntax
Code Block |
---|
WEEKDAY( date )
|
date
format: month/day/year or year-month-day
year (required) - An integer between 1583 and 9956, or 0 - 99.
month (required) - An integer between 1 and 12 representing month.
day (required) - An integer between 1 and 31 representing day of month.
Summary: Extract the day of the week from a date; if text, uses current locale to convert to a date.
Syntax: WEEKDAY( DateParam Date [ ; IntegerType = 1 ] )
Returns: Number
Constraints: None
Semantics: Returns the day of the week from a date, as a number from 0 through 7. The exact meaning depends on the value of Type:
- When Type is 1, Sunday is the first day of the week, with value 1; Saturday has value 7.
- When Type is 2, Monday is the first day of the week, with value 1; Sunday has value 7.
- When Type is 3, Monday is the first day of the week, with value 0; Sunday has value 6.
Day of Week | Type=1 Result | Type=2 Result | Type=3 Result |
---|---|---|---|
Sunday | 1 | 7 | 6 |
Monday | 2 | 1 | 0 |
Tuesday | 3 | 2 | 1 |
Wednesday | 4 | 3 | 2 |
Thursday | 5 | 4 | 3 |
Friday | 6 | 5 | 4 |
Saturday | 7 | 6 | 5 |
Examples
Syntax | Result |
---|---|
report: =WEEKDAY(DATEVALUE("6/21/69")) | 7 |
: WEEKDAY("1969-6-21" =WEEKDAY(DATE(1900,1,1),1) | 7 |
BDate = "6/21/69" | 7 |