The WEEKDAY function in Google Sheets is a useful tool that converts a specified date into a number corresponding to the day of the week. This function is essential for various scheduling, planning, and data analysis tasks, allowing users to understand the day associated with any date provided.
Syntax
WEEKDAY(date, [type])
- date: A valid date from which to determine the weekday.
- type (optional): A number that determines the day considered the start of the week. The default is 1, which indicates Sunday.
Example #1
WEEKDAY("2023-10-02")
This function evaluates the date October 2, 2023. Since this date falls on a Monday, it would return 2 as the result.
Example #2
WEEKDAY("2023-10-02", 2)
By using type 2, this function assesses the same date but considers Monday as the first day of the week. Therefore, it returns 1 for Monday.
Example #3
WEEKDAY("2023-10-02", 3)
In this instance, with type set to 3, the function indicates that the week starts on Tuesday. As October 2, 2023, is a Monday, it returns 0.
Error handling
- VALUE!: This error occurs if the date supplied is not a recognizable date format in Google Sheets.
- NUM!: This error arises when the type parameter is outside the allowed range (anything other than 1, 2, or 3).