Returns the day of the week (1 through 7) for the specified date. By default, the function starts counting on Sunday (1 = Sunday, 2 = Monday, and so on). For example, the function returns:
- 1 for Sunday, January 1, 2012
- 2 for Monday, December 31, 2012
Syntax
weekday(date)
Parameters
date
can be any of the following:
- Another function that returns a date.
- A formula column that returns a date.
Examples
- If today is Sunday, January 1, 2012, the following function returns 1:
weekday(today())
- If December 31, 2013 is a Tuesday, The following function returns 3:
weekday(date(2013,12,31))