If function, week day

aryanaveen

Board Regular
Joined
Jan 5, 2015
Messages
96
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>
 

Some videos you may like

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

63falcondude

Well-known Member
Joined
Jan 15, 2016
Messages
3,572
Try

<b>Excel 2010</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #BBB"><colgroup><col width="25px" style="background-color: #DAE7F5" /><col /><col /><col /><col /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: #DAE7F5;text-align: center;color: #161120"><th></th><th>A</th><th>B</th><th>C</th><th>D</th><th>E</th><th>F</th><th>G</th><th>H</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style=";">Date</td><td style=";">Time</td><td style=";">Cutoff</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style=";">Holiday list</td></tr><tr ><td style="color: #161120;text-align: center;">2</td><td style="text-align: right;;">1/10/2017</td><td style="text-align: right;;">12:25:00 PM</td><td style=";">received before cutoff</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;">1/11/2017</td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style="text-align: right;;">1/11/2017</td><td style="text-align: right;;">12:15:00 PM</td><td style=";">received after cutoff</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;">1/15/2017</td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style="text-align: right;;">1/12/2017</td><td style="text-align: right;;">12:55:00 PM</td><td style=";">received before cutoff</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;">2/1/2017</td></tr><tr ><td style="color: #161120;text-align: center;">5</td><td style="text-align: right;;">1/13/2017</td><td style="text-align: right;;">12:25:00 PM</td><td style=";">received before cutoff</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;">3/15/2017</td></tr><tr ><td style="color: #161120;text-align: center;">6</td><td style="text-align: right;;">1/14/2017</td><td style="text-align: right;;">12:25:00 PM</td><td style=";">received after cutoff</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;">4/22/2017</td></tr><tr ><td style="color: #161120;text-align: center;">7</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;">6/30/2017</td></tr><tr ><td style="color: #161120;text-align: center;">8</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;">12/25/2017</td></tr></tbody></table><p style="width:3.6em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid #BBB;border-top:none;text-align: center;background-color: #DAE7F5;color: #161120">Sheet1</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: #FFFFFF" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #BBB"><thead><tr style=" background-color: #DAE7F5;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #DAE7F5;color: #161120">C2</th><td style="text-align:left">=IF(<font color="Blue">AND(<font color="Red">WEEKDAY(<font color="Green">A2,2</font>)<6,B2<TIME(<font color="Green">18,0,0</font>),COUNTIF(<font color="Green">$H$2:$H$8,A2</font>)=0</font>),"received before cutoff","received after cutoff"</font>)</td></tr></tbody></table></td></tr></table><br /><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:

sunny102

Board Regular
Joined
Dec 19, 2016
Messages
102
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:

aryanaveen

Board Regular
Joined
Jan 5, 2015
Messages
96
for some reasons your formula is not working for me, But thank you for your suggestion
 

Watch MrExcel Video

Forum statistics

Threads
1,122,521
Messages
5,596,653
Members
414,083
Latest member
Mrsash

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
Top