Can we use an IF function with WEEKDAY as a question in Excel?

The use of the IF function in conjunction with the WEEKDAY function in Excel allows for the creation of conditional statements based on the day of the week. By using this combination, users can create formulas that perform different actions depending on the day of the week, providing a more dynamic and efficient way of managing data. This feature is particularly useful for tasks such as scheduling and organizing data based on specific weekdays.

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

Excel if WEEKDAY then formula

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.

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

Excel check if date is weekday or weekend

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.

Additional Resources

The following tutorials explain how to perform other common tasks in Excel:

x