Debrief
I'm putting together a workbook that checks the companies scheduling is in compliance with a few working standards regarding time, it seemed like an easy task at first but my formula seems to work sometimes but not others. I haven't worked with Time before in excel so it's a little unknown to me.
What I am trying to do
Create a formula that checks that there are 11 hours between the end time of the first shift and the start time of the second shift.
So if an Employee ends their Monday at 9:00pm, The earliest they should be working will be Tuesday at 8:00am.
My Code
I had thought something like this would work, but it only returns a value when the times are both "AM" or "PM"
Where E8 = Start time of the next shift and F7 = End time of the current shift
Workbook Sample
*I didn't bother including the column with my formula from before as it is currently not working
[TABLE="width: 622"]
<tbody>[TR]
[TD]Employee # (C)[/TD]
[TD]Date (D)[/TD]
[TD]Start (E)[/TD]
[TD]End (F)[/TD]
[TD]Duration (G)[/TD]
[TD]Site (H)[/TD]
[/TR]
[TR]
[TD="align: right"]1204[/TD]
[TD]25-Apr-2016[/TD]
[TD="align: right"]7:15:00 AM[/TD]
[TD="align: right"]8:45:00 AM[/TD]
[TD]1:30[/TD]
[TD]CCAC[/TD]
[/TR]
[TR]
[TD="align: right"]1204[/TD]
[TD]25-Apr-2016[/TD]
[TD="align: right"]9:00:00 AM[/TD]
[TD="align: right"]12:00:00 PM[/TD]
[TD]3:00[/TD]
[TD]OUT[/TD]
[/TR]
[TR]
[TD="align: right"]1204[/TD]
[TD]27-Apr-2016[/TD]
[TD="align: right"]10:00:00 AM[/TD]
[TD="align: right"]11:00:00 AM[/TD]
[TD]1:00[/TD]
[TD]OUT[/TD]
[/TR]
[TR]
[TD="align: right"]1204[/TD]
[TD]27-Apr-2016[/TD]
[TD="align: right"]12:00:00 PM[/TD]
[TD="align: right"]1:00:00 PM[/TD]
[TD]1:00[/TD]
[TD]OUT[/TD]
[/TR]
[TR]
[TD="align: right"]1204[/TD]
[TD]28-Apr-2016[/TD]
[TD="align: right"]12:00:00 PM[/TD]
[TD="align: right"]1:00:00 PM[/TD]
[TD]1:00[/TD]
[TD]OUT[/TD]
[/TR]
[TR]
[TD="align: right"]1204[/TD]
[TD]29-Apr-2016[/TD]
[TD="align: right"]10:00:00 AM[/TD]
[TD="align: right"]11:00:00 AM[/TD]
[TD]1:00[/TD]
[TD]OUT[/TD]
[/TR]
[TR]
[TD="align: right"]1204[/TD]
[TD]29-Apr-2016[/TD]
[TD="align: right"]12:00:00 PM[/TD]
[TD="align: right"]1:00:00 PM[/TD]
[TD]1:00[/TD]
[TD]OUT[/TD]
[/TR]
[TR]
[TD="align: right"]1204[/TD]
[TD]02-May-2016[/TD]
[TD="align: right"]7:15:00 AM[/TD]
[TD="align: right"]8:45:00 AM[/TD]
[TD]1:30[/TD]
[TD]CCAC[/TD]
[/TR]
[TR]
[TD="align: right"]1204[/TD]
[TD]02-May-2016[/TD]
[TD="align: right"]9:00:00 AM[/TD]
[TD="align: right"]12:00:00 PM[/TD]
[TD]3:00[/TD]
[TD]OUT[/TD]
[/TR]
[TR]
[TD="align: right"]1204[/TD]
[TD]04-May-2016[/TD]
[TD="align: right"]10:00:00 AM[/TD]
[TD="align: right"]11:00:00 AM[/TD]
[TD]1:00[/TD]
[TD]OUT[/TD]
[/TR]
[TR]
[TD="align: right"]1204[/TD]
[TD]04-May-2016[/TD]
[TD="align: right"]12:00:00 PM[/TD]
[TD="align: right"]1:00:00 PM[/TD]
[TD]1:00[/TD]
[TD]OUT[/TD]
[/TR]
[TR]
[TD="align: right"]1204[/TD]
[TD]06-May-2016[/TD]
[TD="align: right"]10:00:00 AM[/TD]
[TD="align: right"]11:00:00 AM[/TD]
[TD]1:00[/TD]
[TD]OUT[/TD]
[/TR]
[TR]
[TD="align: right"]1204[/TD]
[TD]06-May-2016[/TD]
[TD="align: right"]12:00:00 PM[/TD]
[TD="align: right"]1:00:00 PM[/TD]
[TD]1:00[/TD]
[TD]OUT[/TD]
[/TR]
</tbody>[/TABLE]
Too Long Didn't Read
I need to write a formula that will tell me how much time is between the end time of the first shift and the start time of the next shift.
Thank you in advance
I'm putting together a workbook that checks the companies scheduling is in compliance with a few working standards regarding time, it seemed like an easy task at first but my formula seems to work sometimes but not others. I haven't worked with Time before in excel so it's a little unknown to me.
What I am trying to do
Create a formula that checks that there are 11 hours between the end time of the first shift and the start time of the second shift.
So if an Employee ends their Monday at 9:00pm, The earliest they should be working will be Tuesday at 8:00am.
My Code
I had thought something like this would work, but it only returns a value when the times are both "AM" or "PM"
Code:
=TEXT(E8-F7,"h:mm")
Workbook Sample
*I didn't bother including the column with my formula from before as it is currently not working
[TABLE="width: 622"]
<tbody>[TR]
[TD]Employee # (C)[/TD]
[TD]Date (D)[/TD]
[TD]Start (E)[/TD]
[TD]End (F)[/TD]
[TD]Duration (G)[/TD]
[TD]Site (H)[/TD]
[/TR]
[TR]
[TD="align: right"]1204[/TD]
[TD]25-Apr-2016[/TD]
[TD="align: right"]7:15:00 AM[/TD]
[TD="align: right"]8:45:00 AM[/TD]
[TD]1:30[/TD]
[TD]CCAC[/TD]
[/TR]
[TR]
[TD="align: right"]1204[/TD]
[TD]25-Apr-2016[/TD]
[TD="align: right"]9:00:00 AM[/TD]
[TD="align: right"]12:00:00 PM[/TD]
[TD]3:00[/TD]
[TD]OUT[/TD]
[/TR]
[TR]
[TD="align: right"]1204[/TD]
[TD]27-Apr-2016[/TD]
[TD="align: right"]10:00:00 AM[/TD]
[TD="align: right"]11:00:00 AM[/TD]
[TD]1:00[/TD]
[TD]OUT[/TD]
[/TR]
[TR]
[TD="align: right"]1204[/TD]
[TD]27-Apr-2016[/TD]
[TD="align: right"]12:00:00 PM[/TD]
[TD="align: right"]1:00:00 PM[/TD]
[TD]1:00[/TD]
[TD]OUT[/TD]
[/TR]
[TR]
[TD="align: right"]1204[/TD]
[TD]28-Apr-2016[/TD]
[TD="align: right"]12:00:00 PM[/TD]
[TD="align: right"]1:00:00 PM[/TD]
[TD]1:00[/TD]
[TD]OUT[/TD]
[/TR]
[TR]
[TD="align: right"]1204[/TD]
[TD]29-Apr-2016[/TD]
[TD="align: right"]10:00:00 AM[/TD]
[TD="align: right"]11:00:00 AM[/TD]
[TD]1:00[/TD]
[TD]OUT[/TD]
[/TR]
[TR]
[TD="align: right"]1204[/TD]
[TD]29-Apr-2016[/TD]
[TD="align: right"]12:00:00 PM[/TD]
[TD="align: right"]1:00:00 PM[/TD]
[TD]1:00[/TD]
[TD]OUT[/TD]
[/TR]
[TR]
[TD="align: right"]1204[/TD]
[TD]02-May-2016[/TD]
[TD="align: right"]7:15:00 AM[/TD]
[TD="align: right"]8:45:00 AM[/TD]
[TD]1:30[/TD]
[TD]CCAC[/TD]
[/TR]
[TR]
[TD="align: right"]1204[/TD]
[TD]02-May-2016[/TD]
[TD="align: right"]9:00:00 AM[/TD]
[TD="align: right"]12:00:00 PM[/TD]
[TD]3:00[/TD]
[TD]OUT[/TD]
[/TR]
[TR]
[TD="align: right"]1204[/TD]
[TD]04-May-2016[/TD]
[TD="align: right"]10:00:00 AM[/TD]
[TD="align: right"]11:00:00 AM[/TD]
[TD]1:00[/TD]
[TD]OUT[/TD]
[/TR]
[TR]
[TD="align: right"]1204[/TD]
[TD]04-May-2016[/TD]
[TD="align: right"]12:00:00 PM[/TD]
[TD="align: right"]1:00:00 PM[/TD]
[TD]1:00[/TD]
[TD]OUT[/TD]
[/TR]
[TR]
[TD="align: right"]1204[/TD]
[TD]06-May-2016[/TD]
[TD="align: right"]10:00:00 AM[/TD]
[TD="align: right"]11:00:00 AM[/TD]
[TD]1:00[/TD]
[TD]OUT[/TD]
[/TR]
[TR]
[TD="align: right"]1204[/TD]
[TD]06-May-2016[/TD]
[TD="align: right"]12:00:00 PM[/TD]
[TD="align: right"]1:00:00 PM[/TD]
[TD]1:00[/TD]
[TD]OUT[/TD]
[/TR]
</tbody>[/TABLE]
Too Long Didn't Read
I need to write a formula that will tell me how much time is between the end time of the first shift and the start time of the next shift.
Thank you in advance