Takes a date and returns a number 1 to 7 for the day-of-week number.
By default, WEEKDAY returns 1 for Monday, 2 for Tuesday, 3 for Wednesday, and so on. You can change the start day for the count by using the optional Type parameter.
- x: Date or date-formatted line item as source.
- y: (Optional) Type parameter.
|Parameter||Sets the week start day to:|
|Input Format||Output Format|
y: Type parameter
The function uses the following arguments:
- x: Time: Date or date-formatted line item.
- [y]: Type parameter: 1 for Monday, 2 for Tuesday, 3, for Wednesday, and so on.
The function has the following constraints:
- Source must be date or date-formatted line item.
- Result must be number-formatted.
- Type for start of day-of-week count is parameters 1 through 7.
WEEKDAY is used to show the day of the week for a Cost & Sales Date date-formatted source line item, where no Type parameter is used. The day-of-week count starts on a Monday - Costs of Sales Date for Mar 12 is 30/03/12, which is a Friday. The function returns 5.
A second example modifies the first to designate Wednesday as the start day of the accounting week—Costs of Sales Date for Mar 12 is 30/03/12, which is a Friday. The function returns 3.