Working hrs. Minus breaktime (8hrs/day) from range of days

PrinceExcel

New Member
Joined
Sep 10, 2018
Messages
31
Work Start: 8:00 am
Work End :5:00 pm
Break Start: 12:00 pm
Break End:1:00pm


I am trying to compute the working hours with raw data like 08/30/2019 4:00pm - 09/02/2019 9:00am. The result in this one should be 2 hrs only. But if the raw data is 09/02/2019 8:00 am - 09/02/2019 9:00am result shpuld be 1 hr. Also ex. 09/02/2019 12:00pm - 2:00pm should be 1 hr since 12-1pm is break time. Basically I am trying to compute working hrs. from range of days subtracting break time and 8 hrs work per day only.

Please help.
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Hi,

Approach: divide working day in 2 shifts. First shift runs from 8 till 12 hrs, second shift runs from 13 till 17 hrs.
So take a look at this and see if this helps:


Book1
ABCDEF
1Work Start: 8:00 am8-1213-17total
2Work End :5:00 pm30/08/2019 16:0002/09/2019 09:001:00:001:00:002:00:00
3Break Start: 12:00 pm02/09/2019 08:0002/09/2019 09:001:00:000:00:001:00:00
4Break End:1:00pm02/09/2019 12:0002/09/2019 14:000:00:001:00:001:00:00
Sheet1
Cell Formulas
RangeFormula
D2=(NETWORKDAYS.INTL(B2,C2,1)-1)*("12:00"-"08:00")+IF(NETWORKDAYS.INTL(C2,C2,1),MEDIAN(MOD(C2,1),"12:00","08:00"),"12:00")-MEDIAN(NETWORKDAYS.INTL(B2,B2,1)*MOD(B2,1),"12:00","08:00")
E2=(NETWORKDAYS.INTL(B2,C2,1)-1)*("17:00"-"13:00")+IF(NETWORKDAYS.INTL(C2,C2,1),MEDIAN(MOD(C2,1),"17:00","13:00"),"17:00")-MEDIAN(NETWORKDAYS.INTL(B2,B2,1)*MOD(B2,1),"17:00","13:00")
 
Upvote 0
Thank you so much..this formula works. I only need to change the cells formal to [h]:mm for it to counts 8 hrs per day.����
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,161
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