# How To Test If A Date Is On A Weekend

This post is going to show you how you can test if a date is on a weekend or a weekday with a simple formula.

## Example

``=OR(WEEKDAY(B3)={1,7})``

This formula tests the date contained in cell B3 to determine if it’s a weekend or weekday.

## Generic Formula

``=OR(WEEKDAY(Date)={1,7})``
• `Date` is the date which you want to test whether it’s a weekend or not.

The formula will return true if the date is a weekend and will return false if it’s a weekday.

## What It Does

This formula will test a given date to see if it’s a weekend (Saturday or Sunday) and return TRUE if it is a weekend and FALSE if it is not a weekend.

## How It Works

The `WEEKDAY(Date)` function will return a number from 1 to 7 depending on what day of the week the date is.

• Returns 1 when the date is on a Sunday
• Returns 2 when the date is on a Monday
• Returns 3 when the date is on a Tuesday
• Returns 4 when the date is on a Wednesday
• Returns 5 when the date is on a Thursday
• Returns 6 when the date is on a Friday
• Returns 7 when the date is on a Saturday

To find the weekend we need to test if `WEEKDAY(Date)` equals 1 or 7 which means either a Saturday or a Sunday. `WEEKDAY(Date)={1,7}` has three possible outcomes.

• {TRUE,FALSE} if the Date is on a Sunday
• {FALSE,TRUE} if the Date is on a Saturday
• {FALSE,FALSE} if the Date is any other weekday

When you apply the OR function to any of these arrays we will get TRUE if the array contains any TRUE values and FALSE otherwise. This happens only when the date is either a Saturday or Sunday.

In our example `WEEKDAY("2017-09-30")={1,7}` results in an array of `{FALSE,TRUE}` since 2017-09-30 is a Saturday. `OR({FALSE,TRUE})` results in TRUE and therefore the date was a weekend.

### John MacDougall

John is a Microsoft MVP and qualified actuary with over 15 years of experience. He has worked in a variety of industries, including insurance, ad tech, and most recently Power Platform consulting. He is a keen problem solver and has a passion for using technology to make businesses more efficient.

### Subscribe

Subscribe for awesome Microsoft Excel videos ðŸ˜ƒ

## Related Posts

#### 8 Ways to Apply a Formula to an Entire Column in Microsoft Excel

Are you wondering how to apply a formula to an entire column in Excel? Read...

#### 5 Ways to Lock and Unlock Formulas in Microsoft Excel

Do you want to lock the formulas in your Excel sheet to prevent other users...

#### 9 Ways to Show Formulas in Microsoft Excel

This post is going to show you all the different ways you can show the...