Using IF/And with Weekday Function to not include Holidays

Hastings

New Member
Joined
Feb 14, 2024
Messages
4
Office Version
  1. 365
Platform
  1. Windows
I am checking the date to make sure it is a weekday
I then check to see if the Task is equal to "no" if it is I return "problem" in the Result column
But I also need to make sure the date isnt a Holiday
How can I insure all conditions are addressed?

Thanks!


1708000096400.png
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Welcome to the Board!

Excel has a function called WORKDAY which also takes into account Holidays, to check to see if a certain date is a Workday or not.
See here for how to use it: Excel Formula: Check If Date Is Workday
 
Upvote 0
Hi & welcome to MrExcel.
How about
Fluff.xlsm
IJKL
1
2problem02/08/2023no
3 03/08/2023yes
4problem04/08/2023no
5 05/08/2023no
6 06/08/2023no
7problem07/08/2023no
8problem08/08/2023no
9problem09/08/2023no
Sheet6
Cell Formulas
RangeFormula
I2I2=IF(AND(WORKDAY(K2-1,1,$P$2:$P$10)=K2,L2="no"),"problem","")
I3:I9I3=IF(AND(WORKDAY(K3-1,1)=K3,L3="no"),"problem","")


Where P2:P10 is the holidays.
 
Upvote 0
Solution
Glad we could help & thanks for the feedback.
 
Upvote 0
On other thing.
What would I add to check if coulmn J has a value and L is eq="no" also flag as a problem?
 
Upvote 0
How about
Excel Formula:
=IF(AND(WORKDAY(K2-1,1,$P$2:$P$10)=K2,L2<>"",J2="no"),"problem","")
 
Upvote 0

Forum statistics

Threads
1,216,025
Messages
6,128,341
Members
449,443
Latest member
Chrissy_M

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