INTRODUCTION
WEEKDAY FUNCTION comes under the DATE AND TIME FUNCTIONS CATEGORY of functions in Excel.
WEEKDAY FUNCTION simply returns the DAY NUMBER of any date in a week.
This function is very simple but helpful in solving many tricky problems concerned with the date and time in Excel.
It is helpful if we need to find out the Week start date or Week end date or put any condition for the particular days of the week etc.
In this article we would learn about the purpose, formula, syntax and examples about the WEEKDAY function in Excel.
PURPOSE OF WEEKDAY FUNCTION IN EXCEL
WEEKDAY FUNCTION returns the DAY of the Week for a given date by the integers from 1 to 7.
For example 1 for Sunday, 2 for Monday and so on.
PREREQUISITES TO LEARN WEEKDAY FUNCTION
THERE ARE A FEW PREREQUISITES WHICH WILL ENABLE YOU TO UNDERSTAND THIS FUNCTION IN A BETTER WAY.
- Basic understanding of how to use a formula or function.
- Basic understanding of rows and columns in Excel.
- If we know the way Excel handles the DATES, the function becomes a bit easier to learn.
- Of course, Excel software.
Helpful links for the prerequisites mentioned above
What Excel does? How to use formula in Excel?
SYNTAX: WEEKDAY FUNCTION IN EXCEL
The Syntax for the WEEKDAY function in Excel is
=WEEKDAY(DATE SERIAL NUMBER, CODE FOR RETURN TYPE)
DATE SERIAL NUMBER is the serial number of the Date or the Date itself for which the day is needed to be found.CODE FOR RETURN TYPE is the code which will decide the day to be counted as 1 as the week is taken from the different days in different parts of the world.
CODE FOR RETURN TYPE | CODE 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). |
EXAMPLE:WEEKDAY FUNCTION IN EXCEL
DATA SAMPLE
For the sake of understanding, let us find out the day number of different dates with different codes.
DATE | WEEK STARTING DAY | |
EXAMPLE 1 | 02-07-2020 | SUNDAY |
EXAMPLE 2 | 08-08-2019 | MONDAY |
EXAMPLE 3 | 12-03-2010 | TUESDAY |
EXAMPLE 4 | 03-12-2015 | WEDNESDAY |
EXAMPLE 5 | 10-05-2013 | THURSDAY |
EXAMPLE 6 | 07-05-2013 | FRIDAY |
EXAMPLE 7 | 05-10-2016 | SATURDAY |
EXAMPLE 8 | 16-10-2019 | MONDAY |
EXAMPLE 9 | 16-05-2013 | TUESDAY |
EXAMPLE 10 | 20-02-2011 | WEDNESDAY |
STEPS TO USE WEEKDAY FUNCTION
Following table gives the description of the formula usage.
The Result is the output which tells the DAY NUMBER of the week on the given date. The formula used is the formula we used to find out the weekday.
The general steps are
- Select the cell where we want to find out the result.
- Put the given formula.
- The general format of the function is
- =WEEKDAY(ADDRESS OF THE DATE, MODE FROM THE ABOVE TABLE).
The result and the formula used for individual examples are given in the table below.
DATE | WEEK STARTING DAY | RESULT(WEEKDAY) | FORMULA USED | |
EXAMPLE 1 | 02-07-2020 | SUNDAY | 4 | =WEEKDAY(Q9,11) |
EXAMPLE 2 | 08-08-2019 | MONDAY | 3 | =WEEKDAY(Q10,12) |
EXAMPLE 3 | 12-03-2010 | TUESDAY | 3 | =WEEKDAY(Q11,13) |
EXAMPLE 4 | 03-12-2015 | WEDNESDAY | 1 | =WEEKDAY(Q12,14) |
EXAMPLE 5 | 10-05-2013 | THURSDAY | 1 | =WEEKDAY(Q13,15) |
EXAMPLE 6 | 07-05-2013 | FRIDAY | 4 | =WEEKDAY(Q14,16) |
EXAMPLE 7 | 05-10-2016 | SATURDAY | 4 | =WEEKDAY(Q15,17) |
EXAMPLE 8 | 16-10-2019 | MONDAY | 2 | =WEEKDAY(Q16,12) |
EXAMPLE 9 | 16-05-2013 | TUESDAY | 2 | =WEEKDAY(Q17,13) |
EXAMPLE 10 | 20-02-2011 | WEDNESDAY | 4 | =WEEKDAY(Q18,14) |