Advanced: Calculate time that falls within period across midnight

G0liath02

New Member
Joined
Feb 25, 2008
Messages
16
Hi All,

I am creating a timesheet using excel 2003 users enter their shift start/finish time and a break start/finish time. Emplyee's can work night shifts (ie across midnight).

There are penalty rates which apply at different times. I need to be able to work out the amount of worked time that fits into a certain time period. eg. 10pm-7.30am, 7.30am-10pm.

Upper Bound: 22:00 (10pm)
Lower Bound: 7:30 (7.30am)


B10:Shift Start - 11:30PM
C10: Shift Finish: 5:00Am
D10: Total Time - =MOD($C10-$B10,1)
E10: Time In Core Period
=IF($C10>=$B10,MIN($C10,UpperBound)-MAX($B10,LowerBound),MAX(0,$C10-LowerBound))
F10: Time Outside Core period =$D10-$E10
Code:

I have attached a spreadsheet to help show the problem.
Any help would be greatly appreciated? I look forward to seeing your possible solutions!

I'm not sure on the exact rules - but I've posted this question on another forum also:
http://www.excelforum.com/excel-gen...e-within-a-period-when-crossing-midnight.html
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

Forum statistics

Threads
1,214,981
Messages
6,122,566
Members
449,089
Latest member
Motoracer88

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