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. Hi experts, I'm looking for divine intervention!

    I need to be able to enter a date that will count back 14 days and show the Monday ahead e.g. enter 18 February 2016 and get a return of 8 February 2016, however at the same time if I enter a date that is a Monday it will show the previous Monday only e.g. enter 15 February and get 8 February.

    I tried using this formula but anytime i enter a date that falls on a Sunday it skips forward to the upcoming Monday...!!??!
    =IF(WEEKDAY(D4)<2,D4+2-WEEKDAY(D4),D4+2-7-WEEKDAY(D4))

    Make sense? Thanks everyone

  2. I have a timesheet for our employee, weekends are highlighted so are US holidays based on countif formula, my dilemma is if a holiday falls on a Saturday I'd like the conditional formatting to highlight a day before instead and if the holiday falls on a Sunday, I'd like cf to highlight it on the time-sheet a day after, Monday. Please help, thanks,

  3. Svetlana,
    Thanks for your tutorial, I want to do finding next the four firday, but without public hoildaym, ie. tomorrow is chrismax hoilday and 7 days later is 1 Jan, so the next four firday would be 8/1, 15/1, 22/1 and 29/1.

    How can i do it in execl? thanks a lot

    • Hello, Jesse,

      Please enter the formulas below to 4 different cells:

      =WORKDAY.INTL(A1,1,"1111011",$B$1:$B$3)
      =WORKDAY.INTL(A1,2,"1111011",$B$1:$B$3)
      =WORKDAY.INTL(A1,3,"1111011",$B$1:$B$3)
      =WORKDAY.INTL(A1,4,"1111011",$B$1:$B$3)

      So you'll find the 1st, 2nd, 3rd and 4th Friday. Please note that range $B$1:$B$3 should contain Public holidays.

  4. Very Very Thanks

  5. Svetlana - I need your expertise as I am truly struggling to find the formula for “next week 1st working day”. Currently I am using this formula =IF(A1="","",A1-WEEKDAY(A1)+2+IF(WEEKDAY(A1)>=2,7)) and it works great where every result returned on Monday.

    However, the return date or that Monday is our Public Holidays so it is not going to be our 1st working day of the week. Is there a formula to include Public Holiday? I already have Public Holidays table set up.

    • Hello, Aziruzam,

      The following formula should work for your task:
      =WORKDAY.INTL(IF(A1="","",A1-WEEKDAY(A1)+1+IF(WEEKDAY(A1)>=2,7)),1,1,$B$1:$B$3)

      Please note that range $B$1:$B$3 should contain Public Holidays.

  6. If I have a Saturday date (12/5/2015) how do I figure out how to get a the Saturday date for 2016?

  7. i want to insert starting day and end day and date in excel as follwos

    start date 15.10.2015, end date 16.10.2015

    ans. i want 16-16.10.2015

    • Hello Shiv,

      To enter the date in the format 15.10.2015, select the cells, press Ctl+1, switch to Custom and type the following format in the "Type" box:
      dd.mm.yyyy

  8. Hi
    I want to convert weekday name Mon, Tue, Wed to be converted to no of weekdaylike 1 for sunday, 2 for monday. Can you help me out

    • Hi Surjeet,

      If you have a date displayed as the weekday name, you can use a usual WEEKDAY function like =WEEKDAY(A1)

      If those are the text values, you can use the following nested IF's:

      =IF(A1="Sun", 1, IF(A1="Mon", 2, IF(A1="Tue", 3, IF(A1="Wed", 4, IF(A1="Thu", 5, IF(A1="Fri", 6, IF(A1="Sat", 7, "")))))))

  9. What if I would like to see the text WE + the month and date (in numeric) to my cell? Like WE 11/02.

    Truly appreciate your help.

  10. I want to give employee reviews on the 90th day. If the 90th day falls on a SAT or SUN I want to give the review on the previous FRI instead. How do I use =IF(WEEKDAY function to give the date and not just the text FRI?
    For instance, the review date falls on 11/21/2015 a SAT (in Cell B5) but want to give revised review date of 11/20/2015 a FRI (in Cell C5) instead. Or if review falls on 11/22/2015 a SUN (in Cell B5) but want to give revised review date of 11/20/2015 a FRI.

    I know I have to subtract 1 (SAT) or 2 (SUN) but when I put -1 or -2 it doesn't work. Please I have tried many different ways to no avail.
    Thank you

  11. Hi Svetlana

    It would be a great help if you can tell me the syntax to use a date both as holidays and weekdays (As per situations).

    For example: 1-April-2016 is a Holiday, but if task is done on 1-April-2016 (start date) then the date should be included else excluded.

    Waiting for positive reply :)

  12. Hi!
    Thank you for the article! In a range of dates I need to know how many days there are in one month and how many days in the following month!
    Example:
    30/05/2015-13/06/2015 : 2 days in May and 12 days in June.
    Is it possible? Thank you ;)

  13. Hi
    I want to calculate moving weekly average from the data column. The start date should Sunday ending on Saturday. So the average # should be same for that week and the same for the next week and so on. This is monitor weekly permit limit for a process plant data. I don't need rolling weekly average but moving fixed week average. Thanks.

  14. Hi, I want the spreadsheet to calculate as of the start of the working week (Monday) each time I open it. I use the now function which gives an indication but my data would be more accurate if dated as of the start of week. Can you suggest formula for this please?

  15. WE NEED TO MAKE A SCHEDULE IN THAT 2 PEOPLE WILL WORK EACH WEEKEND (TWO PEOPLE ON SATURDAY AND ONE PERSON ON SUNDAY ) THERE ARE 8 PEOPLE TOTAL TO WORK - HOW WOULD WE GENERATE A RANDOM ROTATION FOR SOMETHING LIKE THIS. IF IT IS NOT RANDOM THE SAME PEOPLE WILL WORK ALL HOLIDAY WEEKENDS
    THANK YOU

  16. Hi,
    Great article, thank you. Not sure if I missed it - I need to count working dates between 2 dates and then working dates relating to the previous month. I can do it long way of cause, but maybe there is an easier way?
    example:
    25/07/15-28/08/15 -25 work days - 4 relates to July

  17. Is it possible to only do certain dates and days of the week, say every Monday, Wednesday, Friday for a certain time frame? Thank you.

    • Hi Luvly,

      It depends on exactly what you mean by "do certain dates". Can you clarify please?

  18. =IF(A2=WEEKDAY("Monday"),"Meade","Sanchez") Would you tell me how to fix this formula? I want the cell to say "Meade" for Monday, Wednesday, and Friday, and "Sanchez" for the ether days. Thank you.

  19. I need to set up a chart with backdating from an event date. Some of those days have to be on a Tuesday. Is it possible to set a formula so that the dates returned are always on a Tuesday, regardless of the day of the week of the original event date? Or, do I have to set each event individually, rather than cut and paste?

    • Dependent on how your data is.

      Conditional format; =weekday(date(year,month,day))=3

      Anything in *s mean link it to relevant cell. I have numbers 1-31 in row 1 for example and months (Jan-15 format) then from B2 till the end of my table I have the conditional format on. The calendar is colour co-ordinated. The date formula only likes numbers, if you are going to link to the "Jan-15" then that part of the formula has to be; date(year(*cell*),month(*cell*),*day*)

      Sunday is day 1, therefore Tuesday day 3

  20. what if I want to calculate the number of days between two dates but only for weekdays (exclude weekend)? thanks.

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 :)