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.
 

Some videos you may like

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

jorismoerings

Well-known Member
Joined
Jul 4, 2014
Messages
1,263
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:

<b></b><table cellpadding="2.5px" rules="all" style=";background-color: rgb(255,255,255);border: 1px solid;border-collapse: collapse; border-color: rgb(187,187,187)"><colgroup><col width="25px" style="background-color: rgb(218,231,245)" /><col /><col /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: rgb(218,231,245);text-align: center;color: rgb(22,17,32)"><th></th><th>A</th><th>B</th><th>C</th><th>D</th><th>E</th><th>F</th></tr></thead><tbody><tr ><td style="color: rgb(22,17,32);text-align: center;">1</td><td style=";">Work Start: 8:00 am</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: center;;">8-12</td><td style="text-align: center;;">13-17</td><td style=";">total</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">2</td><td style=";">Work End :5:00 pm</td><td style="text-align: right;;">30/08/2019 16:00</td><td style="text-align: right;;">02/09/2019 09:00</td><td style="text-align: right;;">1:00:00</td><td style="text-align: right;;">1:00:00</td><td style="text-align: right;;">2:00:00</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">3</td><td style=";">Break Start: 12:00 pm</td><td style="text-align: right;;">02/09/2019 08:00</td><td style="text-align: right;;">02/09/2019 09:00</td><td style="text-align: right;;">1:00:00</td><td style="text-align: right;;">0:00:00</td><td style="text-align: right;;">1:00:00</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">4</td><td style=";">Break End:1:00pm</td><td style="text-align: right;;">02/09/2019 12:00</td><td style="text-align: right;;">02/09/2019 14:00</td><td style="text-align: right;;">0:00:00</td><td style="text-align: right;;">1:00:00</td><td style="text-align: right;;">1:00:00</td></tr></tbody></table><p style="width:4.8em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid rgb(187,187,187);border-top:none;text-align: center;background-color: rgb(218,231,245);color: rgb(22,17,32)">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: rgb(255,255,255)" ><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: rgb(255,255,255);border-collapse: collapse; border-color: rgb(187,187,187)"><thead><tr style=" background-color: rgb(218,231,245);color: rgb(22,17,32)"><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: rgb(218,231,245);color: rgb(22,17,32)">D2</th><td style="text-align:left">=(<font color="Blue">NETWORKDAYS.INTL(<font color="Red">B2,C2,1</font>)-1</font>)*(<font color="Blue">"12:00"-"08:00"</font>)+IF(<font color="Blue">NETWORKDAYS.INTL(<font color="Red">C2,C2,1</font>),MEDIAN(<font color="Red">MOD(<font color="Green">C2,1</font>),"12:00","08:00"</font>),"12:00"</font>)-MEDIAN(<font color="Blue">NETWORKDAYS.INTL(<font color="Red">B2,B2,1</font>)*MOD(<font color="Red">B2,1</font>),"12:00","08:00"</font>)</td></tr><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">E2</th><td style="text-align:left">=(<font color="Blue">NETWORKDAYS.INTL(<font color="Red">B2,C2,1</font>)-1</font>)*(<font color="Blue">"17:00"-"13:00"</font>)+IF(<font color="Blue">NETWORKDAYS.INTL(<font color="Red">C2,C2,1</font>),MEDIAN(<font color="Red">MOD(<font color="Green">C2,1</font>),"17:00","13:00"</font>),"17:00"</font>)-MEDIAN(<font color="Blue">NETWORKDAYS.INTL(<font color="Red">B2,B2,1</font>)*MOD(<font color="Red">B2,1</font>),"17:00","13:00"</font>)</td></tr></tbody></table></td></tr></table><br />
 

PrinceExcel

New Member
Joined
Sep 10, 2018
Messages
31
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.&#55356;&#57211;&#55357;&#56396;
 
Last edited:

Watch MrExcel Video

Forum statistics

Threads
1,099,048
Messages
5,466,249
Members
406,474
Latest member
osama beskales

This Week's Hot Topics

Top