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

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
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
Time
In
Out
In
Out
7:15
11:00
11:30
18:57
7:00
11:00
11:30
19:40
6:45
11:00
11:30
16:04
18:15
0:00
0:30
7:12
20:45
0:00
0:30
8:22


<tbody>
</tbody>

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.

Hourly Breakdown
Straight
Overtime
Lunch
Sick
Vacation
0.00
0.00
0.00
0.00
8.00
0.5
0.00
0.00
8.00
0.00
0.5
0.00
0.00
8.00
0.00
0.5
0.00
0.00
12.95
4.95
0.5
0.00
0.00
11.62
3.62
0.5
0.00
0.00
0.00
0.00
0.00
0.00
40.00
8.57
2.50
0.00
0.00


<tbody>
</tbody>
 
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
That looks good! I am going to try it. I think maybe I was trying to over formulate it a bit!
 
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,216,590
Messages
6,131,610
Members
449,657
Latest member
Timber5

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