weeknum

Returns the week number (1 through 52, 53, or 54) for the specified date. For example, the function returns:

  • 1 for January 1, 2012
  • 53 for December 31, 2012

Syntax

weeknum(date, [week_start_day])

  • date can be any of the following:

    • Another function that returns a date.
    • A formula column that returns a date.
  • week_start_day (optional): A number indicating which numbering system to use when calculating the week number. Valid values are:

    • 1: (default) The first week of the year is the week containing January 1, which is numbered week 1.
    • 2: The first week of the year is the week containing the first Thursday of the year, which is numbered as week 1.

Examples

  • If today is January 1, 2012 the following function returns 1:
    weeknum(today())
  • The following function returns 53:
    weeknum(date(2013,12,31))
  • The following function returns 54:
    weeknum(date(2013,12,31), 2)
  • If c:"specialDay" is a formula column that specifies October 1, 2015, the following function returns 40:
    weeknum(c:"specialDay")
Was this article helpful?
How can we improve it?