Time Calculation When Working Past Midnight That Rounds W/Lunch Punches

blinhart

New Member
Joined
Apr 17, 2018
Messages
9
I have a timecard sheet I am working on that I got to figure the time worked and round to the nearest quarter hour, which is what i wanted it to do. However, I can't seem to get it to work if that person takes a lunch hour and their shift goes past midnight into the next day. In row 45 when there is just an in & out punch it works fine. But if I try to add a lunch hour, I get a negative return value. One crew works 7 pm until 7:15 am the next day for one shift, then the shift rotates every 3 months to 7 am until 7:15 pm. Sometime they leave for dr appt or something and may only work 8-9 hours. Any help is appreciated.

MIN(ROUND(SUM((D45-C45)+(D45<c45))*96,0) 4,12.25)="" -="" formula="" work="" without="" a="" lunch="" hour="" punch

MIN(ROUND(SUM((F46-C46)-(E46-D46))*96,0)/4,8) - formula I am trying to use and it returns a -11.50

Cross posted https://www.excelforum.com/excel-for...h-punches.html
</c45))*96,0)>
 
Last edited by a moderator:

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
The midnight date change can be difficult to deal with. Here's the formulas I came up with.


Book1
BCDEFGHIJKL
44Week(IN)(OUT)(IN)(OUT)(IN)(OUT)(IN)(OUT)Reg HoursOT Hours
45SUN19:0007:1512.250.00
46MON19:0002:0003:0008:2412.250.25
47TUE19:0006:5011.750.00
48WED19:0002:1503:0008:3512.250.50
Template
Cell Formulas
RangeFormula
K45=MIN(MROUND(24*(SUMIF($C$44:$J$44,"(OUT)",C45:J45)-TRUNC(SUMIF($C$44:$J$44,"(OUT)",C45:J45)+COUNT(C45:J45)*5/48) -SUMIF($C$44:$J$44,"(IN)",C45:J45)+TRUNC(SUMIF($C$44:$J$44,"(IN)",C45:J45)+COUNT(C45:J45)*5/48)),0.25),12.25)
L45=IFERROR(MROUND(24*(SUMIF($C$44:$J$44,"(OUT)",C45:J45)-TRUNC(SUMIF($C$44:$J$44,"(OUT)",C45:J45)+COUNT(C45:J45)*5/48) -SUMIF($C$44:$J$44,"(IN)",C45:J45)+TRUNC(SUMIF($C$44:$J$44,"(IN)",C45:J45)+COUNT(C45:J45)*5/48))-12.25,0.25),0)
 
Upvote 0

Forum statistics

Threads
1,223,901
Messages
6,175,277
Members
452,629
Latest member
SahilPolekar

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