To get weekday numbers in Excel, use the =WEEKDAY(serial_number, [return_type]) function. This formula converts a specific date into a number (typically 1 through 7), allowing you to identify if a date falls on a Sunday, Monday, or any other day of the week for the purpose of scheduling, payroll, or data analysis.
What You'll Need
- A computer with Microsoft Excel installed (works on all modern versions including Office 365, Excel 2021, 2019, and 2016).
- A dataset containing dates formatted as valid Excel date values.
- Basic knowledge of how to enter a formula into a cell.
Step-by-Step
- Prepare Your Date Column: Ensure your dates are entered correctly in a column. For example, place your dates in column A, starting at cell A2. If your dates are stored as text, the WEEKDAY function may return a #VALUE! error. You can check this by selecting the cell and ensuring the Number Format in the Home tab is set to "Date".
- Select the Target Cell: Click on the cell where you want the weekday number to appear (e.g., cell B2).
- Enter the Basic Formula: Type
=WEEKDAY(A2)and press Enter. By default, Excel uses the "Return Type 1," which means Sunday is 1 and Saturday is 7. - Choose Your Return Type: Depending on your region or business needs, you may want Monday to be the first day of the week. To do this, add a comma and a number after the cell reference. The syntax is
=WEEKDAY(A2, [return_type]). Common options include:- 1 (or omitted): Sunday = 1, Saturday = 7.
- 2: Monday = 1, Sunday = 7.
- 3: Monday = 0, Sunday = 6.
=WEEKDAY(A2, 2). - Apply the Formula to the Entire Column: Hover your mouse over the bottom-right corner of cell B2 until the cursor turns into a small black cross (the fill handle). Click and drag the handle down to the end of your date list to apply the calculation to all rows.
- Verify the Results: Cross-reference a few of the numbers with a calendar. If you used return type 2 and the date is a Monday, the cell should display 1.
Common Mistakes
One of the most frequent errors is forgetting the return type argument. Many users assume Excel automatically knows whether their week starts on Sunday or Monday based on their system settings, but the WEEKDAY function requires an explicit argument if you want something other than the Sunday=1 default. If you omit the second number, you may miscalculate your business days by one full day.
Another common mistake is attempting to use the WEEKDAY function on a cell that looks like a date but is actually formatted as text. Excel stores dates as sequential serial numbers (e.g., January 1, 1900, is serial number 1). If the date is entered as "October 12th, 2023" in a text format, the function cannot perform the math and will fail. Always ensure your source data is recognized as a Date type by Excel.
Users also often confuse the WEEKDAY function with the TEXT function. While =TEXT(A2, "dddd") will give you the word "Monday," the WEEKDAY function specifically provides a digit. If you need the number for further calculations (like adding a bonus for weekend work), you must use WEEKDAY; if you only need a visual label, TEXT is the better choice.
Tips
To make your weekday numbers more readable, you can combine the WEEKDAY function with a CHOOSE function. Instead of seeing a "2," you can make Excel display "Monday." The formula would look like this: =CHOOSE(WEEKDAY(A2, 2), "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"). This allows you to keep the mathematical logic of the weekday number while presenting a human-readable label.
If you are using weekday numbers to highlight weekends in a large spreadsheet, use Conditional Formatting. Select your date range, go to Home > Conditional Formatting > New Rule > Use a formula to determine which cells to format. Enter =WEEKDAY(A2, 2) > 5. This tells Excel to highlight any cell where the weekday number is 6 (Saturday) or 7 (Sunday). Set a fill color like light red to instantly visualize your weekends.
For advanced users tracking project timelines, the WEEKDAY function is a powerful companion to the NETWORKDAYS function. While NETWORKDAYS tells you how many working days are between two dates, using WEEKDAY allows you to identify exactly which specific dates in a sequence are non-working days, which is essential for creating custom Gantt charts or shift rotations.
Troubleshooting
If your formula returns a #VALUE! error, the first step is to check the data type of your date. Select the cell and look at the "Number" group in the Home tab. If it says "Text," try converting it by selecting the column, going to the Data tab, selecting "Text to Columns," and clicking "Finish" immediately. This often forces Excel to re-evaluate text-dates as actual date values.
If the formula returns a date (like January 1, 1900) instead of a number (like 1), it is because the cell containing the formula is formatted as a Date. Excel sees the result "1" and thinks you want to see the first date in its calendar system. To fix this, select the cell, go to the Home tab, and change the dropdown menu from "Date" to "General" or "Number." The date will then transform back into the correct weekday digit.
If the weekday number is consistently off by one day, check your return type argument. If you are in a region where the week starts on Monday but you used the default =WEEKDAY(A2), your results will be shifted. Change the formula to =WEEKDAY(A2, 2) to align the numbering with a Monday start.
Frequently Asked Questions
Can I use WEEKDAY to find only business days?
The WEEKDAY function identifies the day of the week, but it doesn't inherently filter for business days. However, you can use it inside an IF statement: =IF(WEEKDAY(A2, 2) < 6, "Business Day", "Weekend").
What is the difference between return type 2 and return type 3?
Return type 2 assigns Monday as 1 and Sunday as 7. Return type 3 assigns Monday as 0 and Sunday as 6. Type 3 is particularly useful for programmers or those using the result in other mathematical offsets where a zero-based index is required.
Does the WEEKDAY function account for holidays?
No, the WEEKDAY function only recognizes the day of the week based on the calendar. It does not know if a specific date is a public holiday. To handle holidays, you should use the WORKDAY or NETWORKDAYS functions and provide a separate list of holiday dates as an argument.
Will this formula work in Google Sheets?
Yes, the WEEKDAY function is standard across both Microsoft Excel and Google Sheets, and the syntax for the return types is identical in both applications.
How do I get the weekday number for "today" automatically?
You can nest the TODAY function inside the WEEKDAY function. Use =WEEKDAY(TODAY(), 2). This will always return the number for the current day, updating automatically every time the spreadsheet is opened or recalculated.