How to Use the WEEKDAY Function in Excel
Below is a detailed guide on how to use the WEEKDAY function in Microsoft Excel and Google Sheets.
Introduction
The WEEKDAY function is designed to determine the day of the week corresponding to a specific date, returning a numerical value ranging from 1 to 7. By default, this function considers Sunday as the first day of the week (1).
Syntax
The syntax for the WEEKDAY function is as follows:
WEEKDAY(serial_number, [return_type])
serial_number
: This required parameter represents the date you wish to analyze.return_type
: This optional parameter allows you to choose the numbering system for the weekday. If this parameter is omitted, the function defaults to 1 where Sunday is denoted as 1.
Examples
Here are some practical examples of using the WEEKDAY function in Excel and Google Sheets:
Example 1: Basic Usage
Consider a scenario where cell A1 contains the date “10/15/2022.” To find the day of the week for this date, use the formula:
Date | Formula | Result |
---|---|---|
10/15/2022 | =WEEKDAY(A1) | 7 (with the assumption that Sunday is the first day of the week) |
Example 2: Specifying Return Type
If you prefer Monday as the first day of the week, you can change the return type to 2, which makes Monday 1 and Sunday 7:
Date | Formula | Result |
---|---|---|
10/15/2022 | =WEEKDAY(A1, 2) | 6 (with Monday as the first day of the week) |
This adjustment allows you to tailor the return system to fit your specific needs.
Conclusion
The WEEKDAY function is an invaluable tool for determining the weekday of a given date in Excel and Google Sheets. By mastering its syntax and exploring these examples, you can effectively apply this function in your spreadsheets for tasks that require day-of-the-week data.
More information: https://support.microsoft.com/en-us/office/weekday-function-60e44483-2ed1-439f-8bd0-e404c190949a