What is the WEEKDAY Function in Google Sheets?
The WEEKDAY function in Google Sheets takes a date and returns a number between 1 and 7, representing the Day of the week. By default, the WEEKDAY function returns 1 for Sunday and 7 for Saturday. You can use the WEEKDAY function within other formulas to determine the Day of the week. You will learn how to use the DATE function and CHOOSE function along with WEEKDAY function in this article as well.
Why use the WEEKDAY Function in Google Sheets?
Let’s say you have a list of dates of the holidays for the entire year. You want to know which weekdays are most frequently coinciding with the holidays. You can then plan your work schedule by keeping in mind that certain weekdays have the highest number of holidays. You can do this by using the WEEKDAY function in Google Sheets. The function will return the weekday corresponding to the date provided. You can then look for which weekday was highest occurring using the CHOOSE function.
- date – The date for which you want to determine the Weekday/Day of the week. This parameter must be either a reference to a cell containing a date or a function that returns a date type or a number.
- type – [ OPTIONAL – 1 by default ] – This parameter is should be a number. The parameter indicates which numbering system you want to use to represent the weekdays. By default, counts start with Sunday = 1.
- If you type 1, then the days are counted from Sunday, with value of Sunday counted as 1, and therefore, the value of Saturday is counted as 7.
- If you type 2, then the days are counted from Monday, with the value of Monday counted as 1, and therefore, the value of Sunday is counted as 7.
- If you type 3, then the days are counted from Monday, with value of Monday counted as 0, and therefore, the value of Sunday is counted as 6.
WEEKDAY(2072): Here, it will start counting from 1 and divide the number by multiples of 7.
WEEKDAY(2072,2): Here, it will start counting from 1 and divide the number by multiples of 7. However, it will start on Monday, rather than Sunday
WEEKDAY(DATE(2021,7,23)): The DATE function will create date, and the weekday function will return the weekday.
WEEKDAY(A2): You can also reference a cell containing the date to calculate the weekday.
How to use the WEEKDAY Function in Google Sheets?
Example 1: Use WEEKDAY Function on a Date
- Let’s say you want to find the weekday for a particular date.
- Enter that specific date in the weekday parameter, as shown in the example:
- Here, the function will interpret the date and return 7. This means that the weekday is Saturday, as one indicates Sunday.
Example 2: Use the WEEKDAY Function to determine the Day
- The WEEKDAY Function in Google Sheets returns an integer number.
- What if you want the function to return the weekday, e.g. Monday or Tuesday, rather than the number corresponding to it?
- For this, use the WEEKDAY Function along with the CHOOSE Function.
- Here, The Date function converts the input to a date.
- Then, the Weekday function returns an integer number for the date specified.
- Since we have mentioned the second parameter as 2, days are counted from Monday, and the value of Monday is 1; therefore, the value of Sunday is 7.
- Now, the Choose Function will select the String corresponding to the number output of the WEEKDAY function.
- So let’s say the Weekday function returns a number 5, and the CHOOSE Function will choose the 5th string, i.e. Thursday.
You can use the WEEKDAY function in Google Sheets to calculate the WEEKDAY of any input Date. You can see the official documentation here if you want to know more about the WEEKDAY Function in Google Sheets.
Want to know more formulas and functions in Google Sheets? Look at our definitive guide on Google Sheets which covers hundreds of such topics here. Enjoy reading!
How to Create a Burndown Chart in Google Sheets: Learn how to create burndown chart in Google Sheets
How to create a Funnel Chart in Google Sheets: Learn how to create funnel charts in Google Sheets.
How to Use the SORTN Function in Google Sheets: Learn how to use the SORTN function in Google Sheets.
Google Sheets: How to Use Pivot Tables: Learning how to create and use Pivot Tables for analysing data in Google Sheets.
Complete Guide on the REGEXEXTRACT Function in Google Sheets for 2022: Learn how to use the REGEXEXTRACT function in Google Sheets and its variations.