Job tracking formula

adammon

New Member
Joined
Apr 8, 2015
Messages
14
I am trying to capture the working time between a 'Start time' and 'Registering time.' By working time I mean that I want to exclude any breaks, as well as hours not worked if it carried over several days. Our employees typical work day is from 8am to 5pm with a hour long lunch break from 12pm-1pm.

In the example below, rows 2 and 3 go through the employees lunch hour (12pm-1pm) so I would like to subtract that from the duration to get the actual working time.
Row 4 doesn't carry through the lunch hour so the formula would have to stay consistent if it doesn't go through non-working time hours.
Going down to row 6, the employees job carried over to the next day so I would want to subtract the hours from 5pm-8am.

Is there a formula that can work for all occasions so I don't have to make one for each scenario?

Z2ypRU5.jpg


Thanks in advance for the help!
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Does this work for you???? Just Copy D2 down....


Excel 2010
ABCD
1Start TimeRegistering TimeDurationMinus Breaks
204/07/16 10:53:59 AM04/07/16 1:17:52 PM2:23:531:23:53
304/07/16 10:48:19 AM04/07/16 1:21:13 PM2:32:541:32:54
404/07/16 1:15:48 PM04/07/16 1:24:40 PM0:08:520:08:52

<colgroup><col style="width: 25pxpx"><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
C2=B2-A2
D2=IF(AND(A2-INT(A2)<TIMEVALUE("12:00:00"),B2-INT(B2)>TIMEVALUE("01:00:00")),C2-TIMEVALUE("01:00:00"),C2)
C3=B3-A3
D3=IF(AND(A3-INT(A3)<TIMEVALUE("12:00:00"),B3-INT(B3)>TIMEVALUE("01:00:00")),C3-TIMEVALUE("01:00:00"),C3)
C4=B4-A4
D4=IF(AND(A4-INT(A4)<TIMEVALUE("12:00:00"),B4-INT(B4)>TIMEVALUE("01:00:00")),C4-TIMEVALUE("01:00:00"),C4)

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,215,040
Messages
6,122,806
Members
449,095
Latest member
m_smith_solihull

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