Ecel formula for working hours and overtime calculation

minnal_guy2002

New Member
Joined
Feb 16, 2025
Messages
2
Office Version
  1. 2016
Platform
  1. Windows
Dear Expert,

I am finding some difficulties in get the data, need help to resolve this issue.

If Clock In (I2) < 8:00 AM, start counting from 8:00 AM.
If Clock In ≥ 8:00 AM, use the actual Clock In time.

If Clock Out (J2) > 8:00 PM, start counting 8:00 PM.
If Clock Out 8:00 PM, use the actual Clock Out time.

Subtract Clock Out (J2) and Break Time (2 hours).


OP&Outlet OT (Test).xlsx
ABCDEFGHIJKLMN
1NoEmp IDEmp NameBRANCHDEPTPOSITIONAREASECTIONClock InClock OutBreaks 2xTotal HrsRegular HrsOT Hrs
21FWAC0002ROHMOTULLAHKKSMSIM2-JALAN SULTAN ISMAIL 2(KL)SHOP ASSTG1-00010535-SIM27:3021:302.0011:307:304:00
32FWAC0094MD JUNAED MIAKKSMSIM2-JALAN SULTAN ISMAIL 2(KL)SHOP ASSTG1-00010535-SIM28:2317:32 2hrs 7:097:090:00
Sheet1
Cell Formulas
RangeFormula
L2L2=IF(OR(I2="", J2=""), "", (J2 - MAX(I2, TIME(8,0,0))) - (2/24))
M2M2=IF($I$2="","",MIN(7.5/24,MIN(20/24,$J$2)-MAX(7.5/24,I2)-(2/24)))
N2N2=IF($I$2="","",$L$2-$M$2)
L3L3=IF($I$3="","",$J$3-$I$3-(2/24))
M3M3=IF($I$3="","",MIN(7.5/24,MIN(20/24,$J$3)-MAX(7.5/24,I3)-(2/24)))
 
May be something like this,
Book4
ABCDEFGHIJKLMN
1NoEmp IDEmp NameBRANCHDEPTPOSITIONAREASECTIONClock InClock OutBreaks 2xTotal HrsRegular HrsOT Hrs
21FWAC0002ROHMOTULLAHKKSMSIM2-JALAN SULTAN ISMAIL 2(KL)SHOP ASSTG1-00010535-SIM27:3021:302:0014:0010:004:00
32FWAC0094MD JUNAED MIAKKSMSIM2-JALAN SULTAN ISMAIL 2(KL)SHOP ASSTG1-00010535-SIM28:2317:322:009:097:092:00
Sheet1
Cell Formulas
RangeFormula
K2:K3K2=TIME(2,0,0)
L2:L3L2=J2-I2
M2:M3M2=IF(OR(I2="",J2=""), "", MIN(J2, TIME(20,0,0)) - MAX(I2, TIME(8,0,0)) - K2)
N2:N3N2=L2-M2
 
Upvote 0
the actual clock in time is 8am and its should not count as 7.30am working time, and it has to start the calculation at 8.00am. then should minus the break time
 
Upvote 0

Forum statistics

Threads
1,226,771
Messages
6,192,918
Members
453,766
Latest member
Gskier

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