staff schedule

imported_unknown

Active Member
Joined
Jan 13, 2002
Messages
424
I am trying to create a staff schedule. It will finally figure the hours between start and end time, and subtract .5 hour for lunch. Now I need to add another condition for those working less than 5 hours. These should not have the .5 subtracted. This is how I was doing it so far.
=IF((24*(IF(C8>D8,D8+1-C8,D8-C8))-0.5)>0,(24*(IF(C8>D8,C8+1-C8,D8-C8))-0.5),0)
Help?
Thanks.
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
This formula will not work for difference in start and end times of 24 hours or more as the formula does not know the days worked.
Formula should work since no staff will work 24 hours straight.
For work of greater than 5 hours, the formula will take .5 hours for break. 5 hours or less, no 0.5 hours for breaks are deducted.

=IF((24*(IF(C8>D8,D8+1-C8,D8-C8))-0.5)>5,(24*(IF(C8>D8,D8+1-C8,D8-C8))-0.5),24*(D8-C8))
 
Upvote 0
On 2002-10-04 23:07, GLD wrote:
I am trying to create a staff schedule. It will finally figure the hours between start and end time, and subtract .5 hour for lunch. Now I need to add another condition for those working less than 5 hours. These should not have the .5 subtracted. This is how I was doing it so far.
=IF((24*(IF(C8>D8,D8+1-C8,D8-C8))-0.5)>0,(24*(IF(C8>D8,C8+1-C8,D8-C8))-0.5),0)
Help?
Thanks.

Hi GLD:

Welcome to the Board!

Try ...

=IF(((D8-C8)+(C8>D8))*24>5,((D8-C8)+(C8>D8))*24-0.5,((D8-C8)+(C8>D8))*24)

Regards!

Yogi
 
Upvote 0

Forum statistics

Threads
1,214,905
Messages
6,122,172
Members
449,071
Latest member
cdnMech

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