Time Formula

kumara_faith

Well-known Member
Joined
Aug 19, 2006
Messages
953
Office Version
  1. 365
Hi,

I have the following sheet that calculates the downtime in branches based on the specific operating hours everyday.


Excel Workbook
BCDEFGHIJKLMNOPQRST
2**MondayMondayTuesdayTuesdayWednesdayWednesdayThursdayThursdayFridayFridaySaturdaySaturdaySundaySunday*
3Start DateStart TimeEnd DateEnd TimeStart TimeEnd TimeStart TimeEnd TimeStart TimeEnd TimeStart TimeEnd TimeStart TimeEnd TimeStart TimeEnd TimeStart TimeEnd TimeDowntime
42/14/20118.58 PM2/16/20119.06 AM9.30 AM10.30 PM9.30 AM10.30 PM9.30 AM10.30 PM9.30 AM10.30 PM9.30 AM11.00 PM9.30 AM11.00 PM9.30 AM10.30 PM36.08.00
Sheet1


The downtime ahould only take into account during the operating hours and should exclude hours of downtime during non operating hours.

In the example above, the actual downtime during operating hours is 14 hours and 32 minutes. Although the downtime lasted from Feb 14 to Feb 16, the downtime hours that affected operating hours was 14 hours 32 minutes and not 36 hours and 8 minutes.

Is there anyway we could build a formula for this ?

Appreciate all the help.
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Try this formula in T4

=SUMPRODUCT(INT((WEEKDAY(B4-{2,3,4,5,6,7,1})+D4-B4)/7),CHOOSE({1,2,3,4,5,6,7},G4-F4,I4-H4,K4-J4,M4-L4,O4-N4,Q4-P4,S4-R4))-MAX(0,MIN(INDEX(F4:S4,WEEKDAY(B4,2)*2),C4)-INDEX(F4:S4,WEEKDAY(B4,2)*2-1))-MAX(0,INDEX(F4:S4,WEEKDAY(D4,2)*2)-MAX(INDEX(F4:S4,WEEKDAY(D4,2)*2-1),E4))
 
Upvote 0

Forum statistics

Threads
1,224,550
Messages
6,179,463
Members
452,915
Latest member
hannnahheileen

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