1. Calculation functions
  2. All Functions
  3. Time and Date Functions
  4. WEEKDAY

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.

Syntax

WEEKDAY(x,[y])        

where:

  • x: Date or date-formatted line item as source.
  • y: (Optional) Type parameter. 
ParameterSets the week start day to:
1Monday (default)
2Tuesday
3Wednesday
4Thursday
5Friday
6Saturday
7Sunday


Back to Top

Format

Input Format Output Format

x: Time

y: Type parameter

Number (1-7)

Arguments

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.

Constraints

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.

Excel equivalent

Back to Top

Example

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.

Back to Top

Similar functions