IF AND Formula to differentiate day of week

OfficeUser

Well-known Member
Joined
Feb 4, 2010
Messages
542
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
In cell A2 I have a start date. In Cell B2 I have and end date. In Cell D1:V3 I have dates from 9/1/20 to 9/19/20. I am using the following formula in cell D2: =IF(AND(D1>=$A$2,D1<=$B$2),"X","").

I am hoping for a way to say that I only want an "X" placed if the date is Monday-Friday. I thought using cell C2 and placing an "X" there could be a trigger but unsure how to do this. I have attached a screenshot. Can anyone lend some guidance on how to accomplish this? The ultimate end goal would be to have a trigger for Weekdays and another for Weekend days. Thanks for taking a look, much appreciated.

Note: The formula shown is in cell D2 and then I copied it across.
Excel.JPG
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
How about
Excel Formula:
=IF(AND(D1>=$A2,D1<=$B2,WEEKDAY(D1,2)<6),"X","")
 
Upvote 0
Thanks, I have been looking through this site trying to see how its done and how to adapt it, I'll keep reading. Thanks.

The difficult part is figuring out how to add the WEEKDAY function with the AND as part of the formula, I don't see any examples.
 
Upvote 0
Thanks Fluff, that works as intended. Appreciate the guidance from both of you.
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,984
Messages
6,122,601
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top