Skip to content

WEEKDAY

You are currently viewing a sample of the Cram Kit. Click here to unlock everything.

Imagine you've got a dentist appointment on October 15, 2018. You typically work Mondays, Wednesdays, and Fridays, so you'll need to know if you should request off work for this appointment.

Using a calendar, we'd go back to the given date and determine that it's on a Monday, so we'd need to request off work.

The WEEKDAY function does the exact same thing!

Given a date, the WEEKDAY function returns a number between 1-7 representing what day of the week the date is on.

Coding a WEEKDAY function

With our dentist appointment, we needed to figure out what day of the week October 15, 2018 was.

Given the WEEKDAY function template...

=WEEKDAY(serial_number, [return_type])

...we'd first place the date that we're looking for into the serial_number argument. To do this, all we need to do is reference the cell in which the date is placed, so B1.

=WEEKDAY(B1, [return_type])

Because at their core, dates in Excel are actually just really long numbers representing the number of days since January 0, 1990, plus a fraction representing the 24-hour day.

So "1" represents January 1, 1990, "2" represents January 2, 1990, "3 1/24" represents 01:00 on January 3, 1990, and so on.

For [return_type], we can actually leave this blank, since it's wrapped in brackets.

Leaving [return_type] blank results in the days of the week being mapped like so:

Return typeNumbers returnedDays represented
none/blank1-7Sunday-Saturday
.........

Therefore, 1 represents Sunday, 2 represents Monday, and so on.

Now that we've got our WEEKDAY function ready to code, let's plug it into Excel and see what we get!

We get 2, meaning that October 15, 2018 is on a Monday. This matches what we saw on our calendar!

Using different return_types

If we wanted to map the days of the week in a different way, here are some of the other common patterns:

Return typeNumbers returnedDays represented
none/blank1-7Sunday-Saturday
11-7Sunday-Saturday
21-7Monday-Sunday
30-6Monday-Sunday

Given the same date above, let's plug in "2" as our [return_type] like so:

=WEEKDAY(A1, 2)

Notice how this gives us "1" now, since in this [return_type], 1-7 represents Monday-Sunday.

This still means that 10/15/18 occurs on a Monday, except now instead of Monday being mapped to 2, it's mapped to 1!

With the WEEKDAY function, days of the week are (typically) represented with numbers 1-7, representing Sunday-Saturday. You can modify this mapping by changing your [return_type] argument.

Activate AutoScroll