# Excel: How to Use an IF Function with WEEKDAY

You can use the following formulas to create an IF function combined with the WEEKDAY function in Excel:

Formula 1: Create IF Function to Check if Date is on Specific Day of Week

```=IF(WEEKDAY(A2)=1, "Sunday", "Not Sunday")
```

This particular formula checks if the day of the week for the date in cell A2 is on Sunday and returns either “Sunday” or “Not Sunday” as a result.

Formula 2: Create IF Function to Check if Date is on Weekday or Weekend

`=IF(AND(WEEKDAY(A2)>1, WEEKDAY(A2)<7), "Weekday", "Weekend")`

This particular formula checks if the day of the week for the date in cell A2 is on a weekday (Monday-Friday) or weekend (Saturday-Sunday) and returns “Weekday” or “Weekend” as a reuslt.

The following examples show how to use each formula in practice with the following column of dates in Excel:

## Example 1: Create IF Function to Check if Date is on Specific Day of Week

We can type the following formula into cell B2 to check if the date in cell A2 is on a Sunday:

`=IF(WEEKDAY(A2)=1, "Sunday", "Not Sunday")`

We can then click and drag this formula down to each remaining cell in column B:

The formula returns either “Sunday” or “Not Sunday” to indicate if each date in column A is on a Sunday or not.

Note: The WEEKDAY function in Excel returns an integer value between 1 (Sunday) and 7 (Saturday) to indicate the day of the week.

If you would instead like to check if a date is on a different day of the week, simply change the 1 to a different value.

For example, you could use the following formula to check if each date is on a Monday or not:

`=IF(WEEKDAY(A2)=2, "Monday", "Not Monday")`

## Example 2: Create IF Function to Check if Date is on Weekday or Weekend

We can type the following formula into cell B2 to check if the date in cell A2 is on a weekday or a weekend:

`=IF(AND(WEEKDAY(A2)>1, WEEKDAY(A2)<7), "Weekday", "Weekend")`

We can then click and drag this formula down to each remaining cell in column B:

The formula returns either “Weekend” or “Weekday” to indicate if each date in column A is on a weekday (Monday-Friday) or weekend (Saturday-Sunday).

Note: We used the AND function with the WEEKDAY function in Excel to check if a cell had a weekday integer value equal to 2, 3, 4, 5 or 6 to indicate that it was a weekday.