Calc WEEKDAY function

The WEEKDAY function is used to determine the day of the week for a given date.

Help CentreFunctions & Formulas

For a full list of available calculation functions, please read What calculation functions are supported.


Description

The WEEKDAY function is used to determine the day of the week for a given date. It returns the day as a number, with different numbering systems based on the selected format. The day is given as an integer, ranging from 1 (Sunday) to 7 (Saturday), by default.


Syntax

WEEKDAY(date,[return_type])


The WEEKDAY function syntax has the following arguments:

  • date: Required. Dates should be entered either by using the "YYYY-MM-DD" format by using the DATE function, or as results of other formulas or functions.
  • return_type: Optional. A number that determines the type of return value.
Return_typeNumber returned
1 or omittedNumbers 2 (Monday) through 7 (Saturday), and then starting again at 1 (Sunday).
2Numbers 1 (Sunday) through 7 (Saturday).
3Numbers 0 (Sunday) through 6 (Saturday).

Remark

  • The RPA stores dates as sequential serial numbers so they can be used in calculations. By default, January 1, 1900, is serial number 1, and January 1, 2008, is serial number 39448 because it is 39,448 days after January 1, 1900.
  • If serial_number is out of range for the current date base value, a #NUM! error is returned.
  • If return_type is out of the range specified in the table above, a #NUM! error is returned.

Example

FormulaDescriptionResult
=WEEKDAY("2008-02-14")Day of the week, with numbers 1 (Sunday) through 7 (Saturday)5
=WEEKDAY("2008-02-14", 2)Day of the week, with numbers 1 (Monday) through 7 (Sunday)4
=WEEKDAY("2008-02-14", 3)Day of the week, with numbers 0 (Monday) through 6 (Sunday)3

Errors

For a full list of formula errors, please read Formula errors.


Related functions

See it working on your own data

Everything documented here ships with the platform – try the document tools free, or go live in 7 days.