Excel - WEEKDAY Function



WEEKDAY Function

The Excel WEEKDAY function retrieves a numeric value ranging from 1 to 7, representing a day of the week of the specific date serial number. It is categorized under the Date & Time function in Excel. Other functions like VLOOKUP, IF, and COUNTIF can also be merged with the WEEKDAY function.

For example, when the first project was completed, or the first director was hired in the company, that can be identified using the WEEKDAY function.

Compatibility

This advanced Excel function is compatible with the following versions of MS-Excel

  • Excel for Microsoft 365
  • Excel for Microsoft 365 for Mac
  • Excel for the web
  • Excel 2024
  • Excel 2024 for Mac
  • Excel 2021
  • Excel 2021 for Mac
  • Excel 2019
  • Excel 2016
  • Excel 2013
  • Excel 2010
  • Excel 2007

Syntax

The syntax of the WEEKDAY function is as follows −

=WEEKDAY(serial_number, [return_type])

Arguments

You can use the following arguments with the WEEKDAY function −

Argument Description Required / Optional
Serial_number

It specifies a sequential date from which the day of the week will be extracted.

You may directly enter the Dates or utilize the DATE function to enter the DATE or as a result of other functions.

Required
Return_type

A numeric value that identifies the type of return value.

Look at the Return Type Table given below.

Optional

Return Type Table

Return_type Number Returned
1 or omitted Numbers 1 (Sunday) through 7 (Saturday). Behaves like previous versions of Microsoft Excel.
2 Numbers 1 (Monday) through 7 (Sunday).
3 Numbers 0 (Monday) through 6 (Sunday).
11 Numbers 1 (Monday) through 7 (Sunday).
12 Numbers 1 (Tuesday) through 7 (Monday).
13 Numbers 1 (Wednesday) through 7 (Tuesday).
14 Numbers 1 (Thursday) through 7 (Wednesday).
15 Numbers 1 (Friday) through 7 (Thursday).
16 Numbers 1 (Saturday) through 7 (Friday).
17 Numbers 1 (Sunday) through 7 (Saturday).

Points to Remember

  • The Microsoft Excel tool saves dates as sequential serial numbers for further calculations. By default, serial number 1 is assigned to January 1, 1900, and serial number 39448 is assigned to January 1, 2008.
  • If the serial_number argument exceeds the current date base value range, then the WEEKDAY function will retrieve the #NUM! error.
  • If return_type contains a number other than as specified in the table above, then the WEEKDAY function will return the #NUM! error.
  • If the serial_number argument contains a non-numeric value, then the WEEKDAY function will return the #VALUE! error.
  • If the non-numeric value is specified in the return_type argument, then the WEEKDAY function returns the #VALUE! error.

Example of WEEKDAY Function in Excel

In this example, we will insert the WEEKDAY function in the cell range C3:C7, which indicates the day of the week.

Solution

Step 1 − Assume the sample dataset where the list of date serial numbers is specified in the range B3:B7. First, select the C2 cell and enter the formula =WEEKDAY(B2).

What does WEEKDAY Function do in Excel1

After that, hit the Enter tab to obtain the resulting value.

What does WEEKDAY Function do in Excel2

Step 2 − Moreover, move to the C3 cell and write the formula =WEEKDAY(B3,2). Here, the return_type is 2, which means the assignment of day numbers are Numbers 1 (Monday) through 7 (Sunday)

What does WEEKDAY Function do in Excel3

And then, hit the Enter tab to get the resulting value.

What does WEEKDAY Function do in Excel4

Step 3 − Furthermore, select the C4 cell and write the formula =WEEKDAY(B4,3).

What does WEEKDAY Function do in Excel5

After pressing the Enter tab, the WEEKDAY function will retrieve the 4 that represents the "Wednesday" of the given date serial number.

What does WEEKDAY Function do in Excel6

Step 4 − Similarly, double-click on the C5 cell and write the formula =WEEKDAY(B5,15). Here, the return type is 15.

What does WEEKDAY Function do in Excel7

What does WEEKDAY Function do in Excel8

Step 5 − Afterward, write the formula =WEEKDAY(B6,17) in the C6 cell and press the Enter tab.

What does WEEKDAY Function do in Excel9

What does WEEKDAY Function do in Excel10

Step 6 − If you wish to see the name of the day, then use the TEXT function. For instance, select the cell range C2:C6 and write the formula =TEXT(C2,"ddd") in the formula bar.

What does WEEKDAY Function do in Excel11

After that, press the "Ctrl+ Enter" to populate the day name of the selected range of the cells.

What does WEEKDAY Function do in Excel12

Download Practice Sheet

You can download and use the sample data sheet to practice the WEEKDAY function.

Advertisements