Long shot! - Using time stamps, identify how much time was over the weekend

Peptide

Board Regular
Joined
Apr 12, 2016
Messages
224
Office Version
  1. 365
Platform
  1. Windows
Hello, Trying to use time to figure out if a machines down time falls into the weekend or non working hours.

Down time date stamps we have for a certain machine
Start Date/Time: 9/13/19 10:00 (this is a Friday)
End Date/Time: 9/14/19 9:00 (this is a Saturday)
Non Working time: TBD

If the non working time equals 5pm Friday to 7am Monday, the above example TBD would equal 16:00 hours
- Calculation is 5pm Friday to 9am Saturday = 16:00 hours

How do I do a formula to return the 16 hours?

Any help would be GREATLY appreciated!
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
If C2 = 'Running" and B2 is between 5pm FRI and 7am MON, then return the HH:MM from B2 to 7:00 MON, otherwise do the current formula
:eek: It is becoming something of a monster but try this. The first line is the working part of the new condition.

=IF(AND(C2="Running",MEDIAN(WEEKDAY(B2,12)+MOD(B2,1),4+17/24,7+7/24)=WEEKDAY(B2,12)+MOD(B2,1)),(7+7/24)-(WEEKDAY(B2,12)+MOD(B2,1)),
MAX(IF(WEEKDAY(B2,2)>5,B2,MIN(B2,INT(B2)-WEEKDAY(B2,3)+7/24))-IF(WEEKDAY(A2,2)>5,A2,MAX(A2,INT(A2)+7-WEEKDAY(A2,16)+17/24)),0))

Don't ask me to explain it. :cool: :outtahere:
 
Upvote 0

Forum statistics

Threads
1,224,822
Messages
6,181,165
Members
453,021
Latest member
Justyna P

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