If function, week day

aryanaveen

Board Regular
Joined
Jan 5, 2015
Messages
104
Hi All,

Please help me with the below scenario.

Cell A1 has date, cell B1 has time and Range H1:H8 has list of holiday dates.

Now I need a formula which will check the date, time and holiday list, if Date is a weekday and time is before 06:00:00 PM and the date doesn't fall under holiday list then result should be "received before cutoff" else "received after cutoff.

If date falls under holiday list or Saturday and sunday(weekend) then result should be "received after cutoff".

Please help

Date
Time
Cutoff
Holiday list
01/10/2017
12:25:00 PM
01/11/2017
01/11/2017
12:15:00 PM
01/15/2017
01/12/2017
12:55:00 PM
02/01/2017
01/13/2017
12:25:00 PM
03/15/2017
01/14/2017
12:25:00 PM
04/22/2017
06/30/2017
12/25/2017

<tbody>
</tbody>
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Try


Excel 2010
ABCDEFGH
1DateTimeCutoffHoliday list
21/10/201712:25:00 PMreceived before cutoff1/11/2017
31/11/201712:15:00 PMreceived after cutoff1/15/2017
41/12/201712:55:00 PMreceived before cutoff2/1/2017
51/13/201712:25:00 PMreceived before cutoff3/15/2017
61/14/201712:25:00 PMreceived after cutoff4/22/2017
76/30/2017
812/25/2017
Sheet1
Cell Formulas
RangeFormula
C2=IF(AND(WEEKDAY(A2,2)<6,B218,0,0),COUNTIF($H$2:$H$8,A2)=0),"received before cutoff","received after cutoff")
<time(18,0,0),countif($h$2:$h$8,a2)=0),"received before="" cutoff","received="" after="" cutoff")<="" html=""></time(18,0,0),countif($h$2:$h$8,a2)=0),"received>
 
Last edited:
Upvote 0
use this formula

=IF(AND(WORKDAY(A2-1,1,$H$2:$H$8)=A2,B2<(18/24)),"Before","After")

it assumes your data is starting from row2 and row 1 are headers
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,426
Messages
6,119,414
Members
448,895
Latest member
omarahmed1

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