Finance

Charts

Statistics

Macros

Search

How to use the WEEKDAY function in Excel

This function converts a date (serial number) into a weekday number, returning an integer from 1 (Sunday) to 7 (Saturday) by default.

Syntax:
WEEKDAY(serial_number, [return_type])

Arguments:

  • serial_number (required): The date for which to calculate the weekday number.
  • return_type (optional): A number (12, or 3) that determines the numbering system for weekdays:
    • 1 (or omitted): 1 = Sunday, 2 = Monday, …, 7 = Saturday (default).
    • 21 = Monday, 2 = Tuesday, …, 7 = Sunday.
    • 30 = Monday, 1 = Tuesday, …, 6 = Sunday.

 additional return types are available:

    • 111 = Monday, 2 = Tuesday, …, 7 = Sunday.
    • 121 = Tuesday, 2 = Wednesday, …, 7 = Monday.
    • 131 = Wednesday, 2 = Thursday, …, 7 = Tuesday.
    • 141 = Thursday, 2 = Friday, …, 7 = Wednesday.
    • 151 = Friday, 2 = Saturday, …, 7 = Thursday.
    • 161 = Saturday, 2 = Sunday, …, 7 = Friday.
    • 171 = Sunday, 2 = Monday, …, 7 = Saturday.

Background:
Use WEEKDAY() to extract the day of the week from a date. As an alternative, the TEXT() function can return the weekday as a text string (e.g., =TEXT(TODAY(), « dddd »)).

Example:
To highlight Sundays in red within a date column:

  1. Select the date column.
  2. Apply conditional formatting:
    • Go to Format > Conditional Formatting, select Formula, and enter:
      =WEEKDAY(A1, 1) = 1

OR

  • Click Conditional Formatting > New Rule > « Use a formula », then enter the formula above.
  1. Set the formatting to red.

Enter the formula

=WEEKDAY($B11,1)=1

and click the Format button to format the text

The following examples show how the type parameter works:

=WEEKDAY(« 08/03/2008 »,1) returns 1 (Sunday).

=WEEKDAY(« 08/03/2008 »,2) returns 7.

=WEEKDAY(« 08/03/2008 »,3) returns 6.

0 0 votes
Évaluation de l'article
S’abonner
Notification pour
guest
0 Commentaires
Le plus ancien
Le plus récent Le plus populaire
Online comments
Show all comments
Facebook
Twitter
LinkedIn
WhatsApp
Email
Print
0
We’d love to hear your thoughts — please leave a commentx