Excel WEEKDAY function: get day of week, weekends and workdays

If you are looking for an Excel function to get day of week from date, you've landed on the right page. This tutorial will teach you how to use the WEEKDAY formula in Excel to convert a date to a weekday name, filter, highlight and count weekends or workdays, and more.

There are a variety of functions to work with dates in Excel. The day of week function (WEEKDAY) is particularly useful for planning and scheduling, for example to determine the timeframe of a project and automatically remove weekends from the total. So, let's run through the examples one-at-a-time and see how they can help you cope with various date-related tasks in Excel.

WEEKDAY - Excel function for day of week

The Excel WEEKDAY function is used to return the day of the week from a given date.

The result is an integer, ranging from 1 (Sunday) to 7 (Saturday) by default. If your business logic requires a different enumeration, you can configure the formula to start counting with any other day of week.

The WEEKDAY function is available in all versions of Excel 365 through 2000.

The syntax of the WEEKDAY function is as follows:

WEEKDAY(serial_number, [return_type])

Where:

Serial_number (required) - the date that you want to convert to the weekday number. It can be supplied as a serial number representing the date, as a text string in the format that Excel understands, as a reference to the cell containing the date, or by using the DATE function.

Return_type (optional) - determines what day of the week to use as the first day. If omitted, defaults to the Sun-Sat week.

Here is a list of all supported return_type values:

Return_type Number returned
1 or omitted From 1 (Sunday) to 7 (Saturday)
2 From 1 (Monday) to 7 (Sunday)
3 From 0 (Monday) to 6 (Sunday)
11 From 1 (Monday) to 7 (Sunday)
12 From 1 (Tuesday) to 7 (Monday)
13 From 1 (Wednesday) to 7 (Tuesday)
14 From 1 (Thursday) to 7 (Wednesday)
15 From 1 (Friday) to 7 (Thursday)
16 From 1 (Saturday) to 7 (Friday)
17 From 1 (Sunday) to 7 (Saturday)

Note. The return_type values 11 through 17 were introduced in Excel 2010 and therefore they cannot be used in earlier versions.

Basic WEEKDAY formula in Excel

For starters, let's see how to use the WEEKDAY formula in its simplest form to get the day number from date.

For example, to get the weekday from date in C4 with the default Sunday - Saturday week, the formula is:

=WEEKDAY(C4)

If you have a serial number representing the date (e.g. brought by the DATEVALUE function), you can enter that number directly in the formula:

=WEEKDAY(45658)

Also, you can type the date as a text string enclosed in quotation marks directly in the formula. Just be sure to use the date format that Excel expects and can interpret:

=WEEKDAY("1/1/2025")

Or, supply the source date in a 100% reliable way using the DATE function:

=WEEKDAY(DATE(2025, 1,1))

To use the day mapping other than the default Sun-Sat, enter an appropriate number in the second argument. For example, to start counting days from Monday, the formula is:

=WEEKDAY(C4, 2)

In the image below, all the formulas return the day of the week corresponding to January 1, 2025, which is stored as the number 45658 internally in Excel. Depending on the value set in the second argument, the formulas output different results. Using the WEEKDAY formula in Excel

At first sight, it may seem that the numbers returned by the WEEKDAY function have very little practical sense. But let's look at it from a different angle and discuss some formulas that solve real-life tasks.

How to convert Excel date to weekday name

By design, the Excel WEEKDAY function returns the day of the week as a number. To turn the weekday number into the day name, employ the TEXT function.

To get full day names, use the "dddd" format code:

TEXT(WEEKDAY(date), "dddd")

To return abbreviated day names, the format code is "ddd":

TEXT(WEEKDAY(date), "ddd")

For example, to convert the date in A3 to the weekday name, the formula is:

=TEXT(WEEKDAY(A3), "dddd")

Or

=TEXT(WEEKDAY(A3), "ddd")

Please note that in this formula, you should use WEEKDAY with only one argument, serial_number. Do not include return_type, even if your week starts on a day other than Sunday.

Actually, the WEEKDAY function is unnecessary for this formula. The TEXT function alone would work nicely:

=TEXT(A3, "dddd")

Though, we often think of WEEKDAY as the day of week function, which might make this formula easier to remember.

Convert Excel date to weekday name.

Another possible solution is using WEEKDAY together with the CHOOSE function.

For example, to get an abbreviated weekday name from the date in A3, the formula goes as follows:

=CHOOSE(WEEKDAY(A3),"Sun","Mon","Tus","Wed","Thu","Fri","Sat")

Here, WEEKDAY returns a serial number from 1 (Sun) to 7 (Sat) and CHOOSE selects the corresponding value from the list. Since the date in A3 (Wednesday) corresponds to 4, CHOOSE outputs "Wed", which is the 4th value in the list. WEEKDAY formula to get day name from date

Though the CHOOSE formula is slightly more cumbersome to configure, it provides more flexibility letting you output the day names in any format you want. In the above example, we show the abbreviated day names. Instead, you can deliver full names, custom abbreviations or even day names in a different language.

For more examples, see Excel formula to get day of week from date.

Excel WEEKDAY formula to find and filter workdays and weekends

When dealing with a long list of dates, you may want to know which ones are working days and which are weekends.

To identify weekends and weekdays in Excel, build an IF statement with the nested WEEKDAY function. For example:

=IF(WEEKDAY(A3, 2)<6, "Workday", "Weekend")

This formula goes to cell A3 and is copied down across as many cells as needed.

In the WEEKDAY formula, you set return_type to 2, which corresponds to the Mon-Sun week where Monday is day 1. So, if the weekday number is less than 6 (Monday through Friday), the formula returns "Workday", otherwise - "Weekend". WEEKDAY formula to identify workdays and weekends

To filter weekends or workdays, apply Excel filter to your dataset (Data tab > Filter) and select either "Weekend" or "Workday".

In the screenshot below, we have weekdays filtered out, so only weekends are visible: Filter weekends in Excel.

If some regional office of your organization works on a different schedule where the days of rest are other than Saturday and Sunday, you can easily adjust the WEEKDAY formula to your needs by specifying a different return_type.

For example, to treat Saturday and Monday as weekends, set return_type to 12, so you'll get the "Tuesday (1) to Monday (7)" week type:

=IF(WEEKDAY(A2, 12)<6, "Workday", "Weekend")

How to highlight weekends workdays and in Excel

To spot weekends and workdays in your worksheet at a glance, you can get them automatically shaded in different colors. For this, use the weekday/weekend formula discussed in the previous example with Excel conditional formatting. As the condition is implied, we only need the core WEEKDAY function without the IF wrapper.

To highlight weekends (Saturday and Sunday):

=WEEKDAY($A2, 2)<6

To highlight workdays (Monday - Friday):

=WEEKDAY($A2, 2)>5

Where A2 is the upper-left cell of the selected range.

To set up the conditional formatting rule, the steps are:

  1. Select the list of dates (A2:A15 in our case).
  2. On the Home tab, in the Styles group, click Conditional formatting > New Rule.
  3. In the New Formatting Rule dialog box, select Use a formula to determine which cells to format.
  4. In the Format values where this formula is true box, enter the above-mentioned formula for weekends or weekdays.
  5. Click the Format button and select the desired format.
  6. Click OK twice to save the changes and close the dialog windows.

For the detailed information on each step, please see How to set up conditional formatting with formula.

The result looks pretty nice, doesn't it? Highlight weekends and weekdays in Excel.

How to count weekdays and weekends in Excel

To get the number of weekdays or weekends in the list of dates, you can use the WEEKDAY function in combination with SUM. For example:

To count weekends, the formula in D3 is:

=SUM(--(WEEKDAY(A3:A20, 2)>5))

To count weekdays, the formula in D4 takes this form:

=SUM(--(WEEKDAY(A3:A20, 2)<6))

In Excel 365 and Excel 2021 that handle arrays natively, this works as a regular formula as shown in the screenshot below. In Excel 2019 and earlier, press Ctrl + Shift + Enter to make it an array formula. Count weekdays and weekends in Excel.

How these formulas work:

The WEEKDAY function with return_type set to 2 returns a day number from 1 (Mon) to 7 (Sun) for each date in the range A3:A20. The logical expression checks if the returned numbers are greater than 5 (for weekends) or less than 6 (for weekdays). The result of this operation is an array of TRUE and FALSE values.

The double negation (--) coerces the logical values to 1's and 0's. And the SUM function adds them up. Given that 1 (TRUE) represents the days to be counted and 0 (FALSE) the days to be ignored, you get the desired result.

Tip. To calculate weekdays between two dates, use the NETWORKDAYS or NETWORKDAYS.INTL function.

If weekday then, if Saturday or Sunday then

Finally, let's discuss a bit more specific case that shows how to determine the day of the week, and if it's Saturday or Sunday then do something, if a weekday then do something else.

IF(WEEKDAY(cell, 2)>5, if_weekend_then, if_weekday_then)

Suppose you are calculating payments for employees who have done some extra work on their days off, so you need to apply different payments rates for workdays and weekends. This can be done using the following IF statement:

  • In the logical_test argument, nest the WEEKDAY function that checks whether a given day is a workday or weekend.
  • In the value_if_true argument, multiply the number of working hours by the weekend rate (G4).
  • In the value_if_false argument, multiply the number of working hours by the workday rate (G3).

The complete formula in D3 takes this form:

=IF(WEEKDAY(B3, 2)>5, C3*$G$4, C3*$G$3)

For the formula to copy correctly to the below cells, be sure to lock the rate cell addresses with the $ sign (like $G$4). Calculate payment for workdays and weekends.

WEEKDAY function not working

Generally, there are two common errors that a WEEKDAY formula may return:

#VALUE! error occurs if either:

  • Serial_number or return_type is non-numeric.
  • Serial_number is out of supported dates range (1900 to 9999).

#NUM! error occurs when return_type is out of the permitted range (1-3 or 11-17).

This is how to use the WEEKDAY function in Excel to manipulate days of week. In the next article, we will explore Excel functions to operate on bigger time units such as weeks, months and years. Please stay tuned and thank you for reading!

Practice workbook for download

WEEKDAY formula in Excel - examples (.xlsx file)

284 comments

  1. Pls sir, I need a formula that would calculate the total amount gotten in a week for business, thanks.

  2. Hi! I am trying to get the week ending of the the week day from my data however, I always end up getting "SPILL" error. Here's my formula, =IFERROR(IF(WEEKDAY(A:A)=7,7,7-WEEKDAY(A:A))+A:A,"") how should I correct this?

  3. Hello,

    I have a report that pulls the correct data, expect for the Saturday Data File. On Mondays the data is pulling Thursdays and I need it to grab Late Friday/early Saturday morning file.

    If Weekday(Now()) = 2 Then

    Format(Now() - 2, "yyyy") & Format(Now() - 2, "mm") & Format(Now() - 2, "dd") & ".csv

  4. Hi there, I run puppy classes and on my excel spreadsheet I would like to have a row that gives each date for a certain day of the week for the rest of the year.
    For example, Saturday puppy classes, for attendance register, I want all the Saturday's for the rest of the year in a certain row. Can I do that?

  5. Hello,
    I am working with a document that shows dates of service. I have an empty column next to it and I am searching for a formula that returns the billing week dates (Sun-Sat).
    For example:
    Billing Date: 5/1/2024
    I am searching for a formula that will return the dates of the entire week that the billing date is from (4/29-5/4).

    Thank you.

    • Hi team,
      I need a formula where brings me the days of the month based on the day of the week.
      But some days of the week will repeat itself
      Eg. Mon, Tue, Wed, Wed, Thu, Fri, Sat, Sat and Sun.
      The formula needs to keep the same days of the months for the same days of the week and keep going. Basically doing a schedule.
      Thank you!

  6. Hi all,

    is there a possibility of getting a date from the week and day?

    for example, I need to know what the date of Tuesday was last week.

    If I know that last week was 20 weeks in 2024, and Tuesday is a 2-day of the week, can I get an exact date (in this example is 14.5.2024.)

    thanks.

    • Hi! To determine the date of Tuesday of the twentieth week of the year, try this formula:

      =DATE(2024,1,1)+D1*7-WEEKDAY(DATE(2024,1,1)+D1*7,12)+1 - 7*(WEEKNUM(DATE(2024,1,1)+D1*7-WEEKDAY(DATE(2024,1,1)+D1*7,12)+1)-D1)

      D1 - week number
      Using the DATE function, we get the first day of the year. The WEEKNUM function returns the number of the week for the date that was found and checks to see if it is the exact number that you want.

      • thanks Alexander, this was very helpful :D

  7. Please help. I need to add 5 business to date time format say for example input '08-Aug-23,16:21:47 should return as '15-Aug-23,16:21:47 I tried workday but its not retiring in dd:mm:ss format

  8. Need help in my formula. I need to know if shipping is on time. I have 2 order types. Guaranteed Order is next working day pickup while Regular Order has 2 business day pickup lead time. What formula should I do to know if pickupday is On Time or Late considering holidays and only Sunday as weekend. Thank you in advance.

  9. Dear Ablebits Team,
    I'm Javed, and I was reading your article on how to count weekdays and weekends in Excel. And I see the formula which you mentioned in your article.
    I don't understand that formula. So I try to write my own formula and these are the formulas that I created -

    (a) =LEN(TEXTJOIN(" ",TRUE,IF(WEEKDAY($B$648:$B$663,2)>5,$B$648:$B$663,"")))-LEN(SUBSTITUTE(TEXTJOIN(" ",TRUE,IF(WEEKDAY($B$648:$B$663,2)>5,$B$648:$B$663,""))," ",""))+1

    (b) {=SUM(N(WEEKDAY(B648:B663,2)>5))}

    (c) {=SUM(IF(WEEKDAY(B648:B663,2)>5,1,0))}

    And these 3 formulas give me right answers. And now, I want your clarification on these formulas.

  10. I have maintained monthly calendar in excel for my daily attendance with following details.
    Column "A" is date, "B" is weekday (mon., tue., till sunday), "C" is hours spent in office, "D" is total hours claimed. To sum weekly hours of column "C" and "D", I put manual formula in front of each Sunday in column "E" & "F".

    e.g. if my month day starts from Friday (1.12.23) then I put manual formula in from of Sunday (3.12.23) to sum three days hours. and then for next weekly sum I put manual formula on next Sunday (starting from Monday 4.12.23 till 10.12.23) and so on.

    Now, I need your expert help to avoid this manual work. If you can help me preparing formula for this it will be great help. Formula I am looking which calculates weekly total hours automatically in front of each Sunday.

    Thanks for your help and time in advance.

    • Hello! If I understand your task correctly, try to enter the following formula in cell E2 and then copy it down along the column:

      =IF(WEEKDAY(A2,2)=7, SUMIFS($C$2:C2, $A$2:A2, "<="&A2, $A$2:A2,">="&(EOMONTH(A2,-1)+1)) - SUM($E$1:E1), "")

      Use the WEEKDAY function to define the day of the week on which the counting will be done. The EOMONTH function helps to define the date range from the beginning of the month to the current day. Use these criteria in the SUMIFS function.

      • Thanks a lot for your time and reply... much appreciated….
        God bless you...

  11. I have a list of personal leave taken over the last 2 years for all employees and need to know what day or days of the week the leave was for. Any help would be appreciated.

  12. Hi, Need help for below:

    I would like to create the formula in a single cell (I do not want to add column for weekday/ weekend identification) which will check if particular date is weekday or weekend, and if a weekday it will populate specific number for e.g 10 (Specific columns have this value) or else it will populate 0.

    Pls suggest the logic for this.

  13. I am trying to make a employee schedule with rotating weekends off and every employee gets one weekend off a month.I need to have four people working and one employee off on the weekends. This needs to be done for three shifts. I am trying to use this formula but it has errors:
    =IF(OR(WEEKDAY(B$1)=1,WEEKDAY(B$1)=7),"Working","Off"). How can I correct this? Thank you for your time

    • Hi! It is not possible to create a monthly work schedule for 4 employees with one formula. Describe what result you wanted to get with this formula.

  14. Hi,

    Really need your help with a formula/s.
    In a production environment we start week on Monday at 6am (06:00:00) and finish at 4pm (16:00:00), then start back up next day at 06:00.
    We run Mon - Thurs, but for planning we don't include Fri, Sat or Sun
    I need a formula that will start production at 6am run through til 4pm, if the production time is greater than 10hrs block out the completion date and continue from 6am tues etc etc to give an expected completed date. I'll add in 10 mins for a change over and the the above again.
    Also anything that falls on F, S or S will move to 6am Monday
    Capacity
    Mon - Thur 6:00am - 4:00pm (Break times 1hr & 5 mins per day) Total Production time available is 8 hrs 55 mins)
    Fri, St, Sun - Not running
    Maybe I have written it to be too complicated, please let me know if it is and any help is greatly appreciated

    • Hi!
      If I understand your task correctly, the following formula should work for you:

      =WORKDAY.INTL(A1, INT((B1/24-(TIME(8,55,0) - (A1-INT(A1)-TIME(6,0,0)))) / TIME(8,55,0)),"0000111") + B1/24-(TIME(8,55,0)-(A1-INT(A1)-TIME(6,0,0))) - INT((B1/24-(TIME(8,55,0) - (A1-INT(A1)-TIME(6,0,0))))/TIME(8,55,0))*TIME(8,55,0) + TIME(1,5,0)+TIME(6,0,0)

      A1 - start date&time
      B1 - hours
      You can learn more about WORKDAY.INTL function in this article: Calculating weekdays in Excel - WORKDAY and NETWORKDAYS functions.

      • I'm looking for a formula :

        Allocation of tasks duration Hours .

        6 Working day are from Monday 6 am to Sunday 6 am .

        1 Week off day is from Sunday 6 am to monday 6 am .

        Per day hour is 24 in that utilize hours are 19.35 hours . Break hours 4.65 hours considering by day.

        [ in each utilize hours is 6.45 and Break hours is 1.55 ]

        Working in 3 shifts pattern .

        1 st shift morning 6 am to 2 pm
        2 nd shift 2 pm to 10 pm
        3 rd shift 10 pm to 6 am ( next day )

        Calculate finish date and time each tasks ..
        Ex .
        In column A : A2 cell having project start date & Time : 01.01.2024 6 am

        In column B :
        Cell B2
        Task 1 :
        B3
        Task 2 :

        Goes on ..

        In column C
        Having each tasks completion Hours respectively In cell C2 , C3 etc ..

        In column D

        Need to calculate

        Task completion/ finish date and Time .
        By applying condtions in week day and week off hours

        For task 2 start date will be completion date of task 1

        So please help ..

        • Your request goes beyond the advice we provide on this blog. This is a complex solution that cannot be found with a single formula. If you have a specific question about the operation of a function or formula, I will try to answer it.

          • workday.intl( start date , days , week end , Holidays )

            in general addition formula

            Task Name Task Duration in Hours Task Start Date & Time Task Finish Date & Time
            Task 1 18 01-01-2024 02:00 PM 02-01-2024 08:00 AM

            finish date & time getting is correct.

            used simple formula : Task Start Date & Time + ( Task Duration in Hours / 24 )

            is it possible get correct answer as above by using Formula workday.intl( start date , days , week end , Holidays )

            Task Name Task Duration in Hours Task Start Date & Time Task Finish Date & Time
            Task 1 18 01-01-2024 02:00 PM 01-01-2024 12:00 AM

            02-01-2024 08:00 AM 01-01-2024 12:00 AM

            and weekend : 1 , 2 , 3 etc but my weekend lies between 2 days half / hlaf ; [ sunday 6 AM to Monday 6 AM ]

            Return_type Number returned

            1 or omitted From 1 (Sunday) to 7 (Saturday)
            2 From 1 (Monday) to 7 (Sunday)
            3 From 0 (Monday) to 6 (Sunday)
            11 From 1 (Monday) to 7 (Sunday)
            12 From 1 (Tuesday) to 7 (Monday)
            13 From 1 (Wednesday) to 7 (Tuesday)
            14 From 1 (Thursday) to 7 (Wednesday)
            15 From 1 (Friday) to 7 (Thursday)
            16 From 1 (Saturday) to 7 (Friday)
            17 From 1 (Sunday) to 7 (Saturday)

            please help

              • Thanks !!

  15. I have flights on Mondays, Wednesdays, Fridays and Sundays. I wanted to be able to list dates in a month that corresponds to these days. The easiest way to do is to write them manually from calendar but that is time consuming. Is there a single formula that enable me list dates of all Mondays, Wednesday, Fridays and Sundays in a specific month or ranges of months?

  16. I am currently using a formula to determine a deadline adjustment based on the number of days a project is ahead or behind schedule.

    the formula I'm using is, and this will give me a realistic end date for the project.
    =SUM (O10+-W7)

    Where O10 is the cell that has an original date the project is supposed to end, and W7 is the cell that has formula to count the number of days the project is ahead/behind schedule.

    Is there a way to add to the "=SUM(O10+-W7)" formula so that if the date that is calculated lands on a weekend, it'll automatically move the end date to the next scheduled weekday?

      • Alexander, you ROCK! The update works as it should.

        Thank you so much!

  17. Need please help. Not sure which formula or conditions to include. I have a date 3/25/2023 thru 5/30/2023. I need to count 6 weeks out from 3/25/2023 which would be 5/6/2023 but in workdays to achieve the result in date format.

  18. How do I add 7 days to a column.
    eg:
    27.03.23
    03.04.23
    10.04.23
    etc.

    Thanks. New to Excel.

  19. How can lieu dates for Stat holidays that fall on a weekend be calculated? For example, in 2023, January 1st falls on Sunday and Nov 11th falls on Saturday. If a holiday is on Sunday, it needs to add 1 day and if it's on a Saturday, it needs to add 2 days. Here's my two novice unsuccessful attempts at this formula where D14 is the stat holiday date:

    =IF(WEEKDAY($D14,2)=7,$D14+1)=IF(WEEKDAY($D14,2)=6,$D14+2)
    This returns True if it's a weekday and False if it's a weekend but I want it to return the new date if it's on a weekend and the same date if it's on a weekday.

    =IF(WEEKDAY($D14,2)>5),WORKDAY($D14,2)
    This alternate option is not working at all.

    Thanks in advance for your help.

      • That works with a minor edit at the end of your solution ($D14).
        Thank you so much for helping out a nurse that's trying to create a customized team vacation calendar. So generous of you to share your expertise.

  20. I have created a project schedule with conditional formatting to show week day and weekends - which works perfectly. Each task has a set duration (of workdays) before the final product. I currently have it formatted and coded so I input the due date and it plans backwards using the duration's set for each task.

    This however does not exclude weekends, how do I use excel to automatically update the number of days if a weekend falls in that space?

    IE if a task takes 5 days but day 3 and 4 are weekends the task would update to take 7 days? Is this even possible?

    My aim is to then use that data as a bar graph so the schedule automatically grows/shrinks based on the user inputted requested end date.

Post a comment



Thank you for your comment!
When posting a question, please be very clear and concise. This will help us provide a quick and relevant solution to
your query. We cannot guarantee that we will answer every question, but we'll do our best :)