Forum Discussion

tomislavnadj's avatar
tomislavnadj
Copper Contributor
Oct 21, 2024

Overlaping of worktimes

 

ABCDEF
Start of overtimeEnd of overtimeTotal overtimeStart of Stand-byEnd of Stand-byTotal Standby
0:001:3027:0019:0012
7:0020:00137:0019:000
20:0023:50419:000:001
5:008:3047:0019:0010
   7:0019:0012

 

Hello,

above is example sheet that I use for workers. This is part with standby and overtime, and I need to decrease time of Total Standby with hours of Total overtime only if times overlap, like in table above (if worker is on overtime for 30 and more minutes it is counted as full hour). Overtime can be any hour between 0 - 24h because worker can be called at any time for work in case of emergency (firefighters), but standby is entered only in this way (each row represent new day):

DEF
Start of Stand-byEnd of Stand-byTotal Standby
19:000:005
0:007:007
7:0019:0012

 

7 Replies

  • tomislavnadj 

    In F2:

    =(E2-D2+(E2<D2))*24-ROUNDUP(MAX(MIN(B2+(B2<A2), E2+(E2<D2))-MAX(A2, D2), 0)*24, 0)

    If you use comma as decimal separator, use semicolon ; instead of comma in the formula.

    Apply General number format to F2, then fill down.

    • tomislavnadj's avatar
      tomislavnadj
      Copper Contributor

      HansVogelaar Thank you! I just used round instead of roundup because roundup rounds 1:10 as 2 hours instead of 1 hour. Currently have only issue with round if time difference is less than 1 hour (example 0:21 min) it leaves it as 0 hours instead of 1 hour.

Resources