Day & Night Time calculations with breaks and seperate columns for Reg/OT.

toni689

New Member
Joined
Apr 2, 2013
Messages
4
I have a time sheet that was working great, until I needed to figure night shift hours.

I have columns for clock in/out and lunch in/out. I also need columns to show the number of regular (normal pay) hours and the number of OT hours.

C = clock in, D = clock out lunch, E = clock in lunch, F = clock out.

If statements were used to designate 8 hours for the Regular column:
=IF(((D12-C12)+(F12-E12))*24>8,8,((D12-C12)+(F12-E12))*24)

And also for the OT column:
=IF(((D12-C12)+(F12-E12))*24>8,((D12-C12)+(F12-E12))*24-8,0)

These work great for the way the sheet is setup, but do not play nicely with night shift hours. I need to have a formula that works either way so that I can just plug in the times. I have searched around a bit and tried a few things, but none seem to work in both cases. I'm sure there's a nested +1 or something way to do this, but it eludes me.

Anyone have ideas?
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Welcome to the forum!

Can you post an example of the 4 columns (C:F) for a night shift?

Can completely understand what you're doing for standard hours but need to know how lunch might fall if it was a night shift.
 
Upvote 0
[TABLE="width: 168"]
<tbody>[TR]
[TD="class: xl68, width: 225, bgcolor: transparent, colspan: 4"]Time
[/TD]
[/TR]
[TR]
[TD="class: xl63, bgcolor: transparent"]In
[/TD]
[TD="class: xl63, bgcolor: transparent"]Out
[/TD]
[TD="class: xl63, bgcolor: transparent"]In
[/TD]
[TD="class: xl64, bgcolor: transparent"]Out
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl67, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent, align: right"]7:15
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"]11:00
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"]11:30
[/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]18:57
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent, align: right"]7:00
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"]11:00
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"]11:30
[/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]19:40
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent, align: right"]6:45
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"]11:00
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"]11:30
[/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]16:04
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent, align: right"]18:15
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"]0:00
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"]0:30
[/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]7:12
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent, align: right"]20:45
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"]0:00
[/TD]
[TD="class: xl66, bgcolor: transparent, align: right"]0:30
[/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]8:22

[/TD]
[/TR]
</tbody>[/TABLE]

Thanks for the quick reply! This is one of the weeks that I am looking at. This is why I want one formula for either situation. I do not want to have to edit or copy over seperate formulas according to what day they work nights vs days.

Below is the break down that we use. I need an hourly total for each item listed, but want the Straight (regular) time to only display up to 40 and the added to be placed into OT unless it falls under Sick or Vacation. The lunch column here is not needed, but I added it to try to keep the other columns in check for totals.

[TABLE="width: 287"]
<tbody>[TR]
[TD="colspan: 5"]Hourly Breakdown
[/TD]
[/TR]
[TR]
[TD]Straight
[/TD]
[TD]Overtime
[/TD]
[TD]Lunch
[/TD]
[TD]Sick
[/TD]
[TD]Vacation
[/TD]
[/TR]
[TR]
[TD="align: right"]0.00
[/TD]
[TD="align: right"]0.00
[/TD]
[TD="align: right"][/TD]
[TD="align: right"]0.00
[/TD]
[TD="align: right"]0.00
[/TD]
[/TR]
[TR]
[TD="align: right"]8.00
[/TD]
[TD][/TD]
[TD="align: right"]0.5
[/TD]
[TD="align: right"]0.00
[/TD]
[TD="align: right"]0.00
[/TD]
[/TR]
[TR]
[TD="align: right"]8.00
[/TD]
[TD="align: right"]0.00
[/TD]
[TD="align: right"]0.5
[/TD]
[TD="align: right"]0.00
[/TD]
[TD="align: right"]0.00
[/TD]
[/TR]
[TR]
[TD="align: right"]8.00
[/TD]
[TD="align: right"]0.00
[/TD]
[TD="align: right"]0.5
[/TD]
[TD="align: right"]0.00
[/TD]
[TD="align: right"]0.00
[/TD]
[/TR]
[TR]
[TD="align: right"]12.95
[/TD]
[TD="align: right"]4.95
[/TD]
[TD="align: right"]0.5
[/TD]
[TD="align: right"]0.00
[/TD]
[TD="align: right"]0.00
[/TD]
[/TR]
[TR]
[TD="align: right"]11.62
[/TD]
[TD="align: right"]3.62
[/TD]
[TD="align: right"]0.5
[/TD]
[TD="align: right"]0.00
[/TD]
[TD="align: right"]0.00
[/TD]
[/TR]
[TR]
[TD="align: right"]0.00
[/TD]
[TD="align: right"]0.00
[/TD]
[TD="align: right"][/TD]
[TD="align: right"]0.00
[/TD]
[TD="align: right"]0.00
[/TD]
[/TR]
[TR]
[TD="align: right"]40.00
[/TD]
[TD="align: right"]8.57
[/TD]
[TD="align: right"]2.50
[/TD]
[TD="align: right"]0.00
[/TD]
[TD="align: right"]0.00

[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
Something like this looks like it works


Excel 2010
ABCDEFGHIJ
1TimeHourly Breakdown
2InOutInOutHours WorkedStraightOvertimeLunchSickVacation
3
407:1511:0011:3018:5711.208.003.200.5000
507:0011:0011:3019:4012.178.004.170.5000
606:4511:0011:3016:048.828.000.820.5000
718:1500:0000:3007:1212.458.004.450.5000
820:4500:0000:3008:2211.128.003.120.5000
920:4523:5900:2908:2211.128.003.120.5000
1018:1523:0023:3007:1212.458.004.450.5000
1120:4501:0001:3008:2211.128.003.120.5000
Sheet1
Cell Formulas
RangeFormula
E4=((IF(B4 > A4, B4, B4 + 1) - A4) + (IF(D4 > C4, D4, D4 + 1) - C4)) * 24
F4=IF(E4 > 8, 8, E4)
G4=E4 - F4
H4=(IF(C4 > B4, C4, C4 + 1) - B4) * 24


I've added a couple of my own examples at the bottom to check for other possibilities and it all seems to work.
 
Upvote 0
This works great except for days where there are no values (employee did not work). I just added another IF in the front checking for 0 in the clock in slot.
Thanks for the help!!
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

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