Calculate between date/time when weekend in between

70 Views Asked by At

I have a true false result calculation based on obtaining data between 12pm one day and 12pm the next day. In cell S2, I have: =TODAY()-1 +12/24 In cell S3, I have: =S2+1 -1/1440

This give me a simple true or false in my 'helper' column Q : =AND(G2>=$S$2,G2<=$S$3)

This all works perfectly for me as I extract this data to do other things - BUT, I have a problem in that stupid me forgot about weekends!

So, when look at my data on a Monday afternoon, I get nothing from Friday afternoon (after 12pm) because of course it is much greater than my calculation

I 'think' I can achieve this somehow using IF statement and WEEKDAY equation, but despite trying different examples, I can't get it to work.

Can anyone please point me in the right direction here?

2

There are 2 best solutions below

1
Jayson Chabot On

Would [Column I ] ...greater than, less than formula - help?

enter image description here

Note: Column D ...has a "Zero" (0) for the weekends - but you can adjust the formula to be whatever you want.

0
hepkat63 On

=WORKDAY.INTL(TODAY(),-1)+0.5 and =WORKDAY.INTL(S2,1)+0.5-1/1440 You can even add a list of holidays to skip. – Scott Craner