Formula for work and overtime

Alizakore

New Member
Joined
May 6, 2017
Messages
13
Hello,
I have a simple file where i put my times for work and the overtime. It looks like this:

2017-10-26 14:00-23:00 (30)

(30) is the overtime. I want a code that writes this for me. So the standard-time is 14:00-22:30 and any deviations from this will show in another column.

Thanks!
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
1. Key the standard end time (22:30) into a cell on your worksheet (I used A1 to test this).
2. Assuming your end time is in column C, use the following formula.
=MAX(0,C2-A1)
3. Format the cell as "hmm" and it will display as "030"
 
Upvote 0
.
I took a different approach. Assuming you are paid for 8 hours work regular time with a 30 minute meal break. So anything over 8.5 hrs is overtime.

Also assuming you are willing to change the format you enter your times ... from 14:00 ... change to 14.00 or instead of 23:30 ... change to 23.5
(a quarter hour would be .15 ...... 3/4 hour would be .45)


Excel 2007 32 bit
[TABLE="class: head"]
<tbody>[TR="bgcolor: #888888"]
[TH][/TH]
[TH]
A
[/TH]
[TH]
B
[/TH]
[TH]
C
[/TH]
[TH]
D
[/TH]
[TH]
E
[/TH]
[TH]
F
[/TH]
[TH]
G
[/TH]
[TH]
H
[/TH]
[TH]
I
[/TH]
[TH]
J
[/TH]
[TH]
K
[/TH]
[TH]
L
[/TH]
[TH]
M
[/TH]
[TH]
N
[/TH]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD="bgcolor: #888888"]
1
[/TD]
[TD="bgcolor: #D7E4BC"]
DATE
[/TD]
[TD="bgcolor: #D7E4BC"]
START
[/TD]
[TD="bgcolor: #D7E4BC"]
END
[/TD]
[TD="bgcolor: #D7E4BC"]
TOTAL
[/TD]
[TD="bgcolor: #D7E4BC"]
OVERTIME
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD="bgcolor: #888888"]
2
[/TD]
[TD]
2017-10-26​
[/TD]
[TD]
14.00​
[/TD]
[TD]
23.00​
[/TD]
[TD]
8.50​
[/TD]
[TD]
0.50​
[/TD]
[TD][/TD]
[TD]Format Columns B:D as NUMBER / 2 decimals[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD="bgcolor: #888888"]
3
[/TD]
[TD]
2017-10-27​
[/TD]
[TD]
14.00​
[/TD]
[TD]
22.50​
[/TD]
[TD]
8.00​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD="bgcolor: #888888"]
4
[/TD]
[TD]
2017-10-28​
[/TD]
[TD]
14.00​
[/TD]
[TD]
23.00​
[/TD]
[TD]
8.50​
[/TD]
[TD]
0.50​
[/TD]
[TD][/TD]
[TD]Formula paste in D2 and drag down : =IF(B2="","",IF(C2="","",(C2-B2)-0.5))[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD="bgcolor: #888888"]
5
[/TD]
[TD]
2017-10-29​
[/TD]
[TD]
13.00​
[/TD]
[TD]
23.00​
[/TD]
[TD]
9.50​
[/TD]
[TD]
1.50​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD="bgcolor: #888888"]
6
[/TD]
[TD]
2017-10-30​
[/TD]
[TD]
14.00​
[/TD]
[TD]
23.00​
[/TD]
[TD]
8.50​
[/TD]
[TD]
0.50​
[/TD]
[TD][/TD]
[TD]Formula paste in E2 and drag down : =IF(D2<8,"",IF(D2>8,D2-8, ""))[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid"]
<tbody>[TR]
[TD]Sheet: Sheet1[/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,179
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