Lunch break formula help

JoSmith

New Member
Joined
Mar 29, 2016
Messages
14
I have the below formula correctly which deducts 30mins lunch break from work times

=IF(COUNT(C23:D26)=0,"",SUM(D23-C23+D24-C24+D25-C25+D26-C26))-"0:30"+0

How do I amend this to only deduct the 30 mins if they work longer than 5 hours. My guys sometimes only work 4 hours but then work longer days other days.

Untitled_zpswbg6ehtr.png


Thanks in advance! :)
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Try

Code:
=IF(COUNT(C23:D26)=0,"",SUM(D23:D26,-C23:C26)-(SUM(D23:D26,-C23:C26)>--"05:00")*1/48)
 
Upvote 0
Hi. Sorry it was right. I was using the wrong times.

I am having a different issue now.

I need to be able to use the 4 rows for rostered / worked times separately as there are occasions that my officers do a split shift and I can't seem to get the formula to accommodate this.

Thanks in advance
 
Upvote 0
Can yu gian example of what you mean that? What the current formula does, what you now want.
 
Upvote 0
Can yu gian example of what you mean that? What the current formula does, what you now want.

Sorry was not explaining myself properly.

The current formula I have is this: =IF(COUNT(C11:D14)=0,"",SUM(D11:D14,-C11:C14)-(SUM(D11:D14,-C11:C14)>--"05:00")*1/48)

It works if the guys are just doing one shift which was the original plan. But I have been told that the officers can work multiple shifts i.e. a morning shift and an afternoon shift to make up the 7-8 hrs. The current formula is not recognizing the two or more shifts. For example the 0:01-5:01 shift is 5 hrs and the 10:00-12:00 is 2 hours so it should be saying 7 hours not 16:30

It has me stumped.

Untitled_zpsdxfflzga.png
 
Upvote 0

Forum statistics

Threads
1,216,524
Messages
6,131,176
Members
449,629
Latest member
Mjereza

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