Receiving an Error checking differences in time

Lyryx

New Member
Joined
Aug 18, 2015
Messages
45
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"
Code:
=TEXT(E8-F7,"h:mm")
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

Employee # (C)Date (D)Start (E)End (F)Duration (G)Site (H)
120425-Apr-20167:15:00 AM8:45:00 AM1:30CCAC
120425-Apr-20169:00:00 AM12:00:00 PM3:00OUT
120427-Apr-201610:00:00 AM11:00:00 AM1:00OUT
120427-Apr-201612:00:00 PM1:00:00 PM1:00OUT
120428-Apr-201612:00:00 PM1:00:00 PM1:00OUT
120429-Apr-201610:00:00 AM11:00:00 AM1:00OUT
120429-Apr-201612:00:00 PM1:00:00 PM1:00OUT
120402-May-20167:15:00 AM8:45:00 AM1:30CCAC
120402-May-20169:00:00 AM12:00:00 PM3:00OUT
120404-May-201610:00:00 AM11:00:00 AM1:00OUT
120404-May-201612:00:00 PM1:00:00 PM1:00OUT
120406-May-201610:00:00 AM11:00:00 AM1:00OUT
120406-May-201612:00:00 PM1:00:00 PM1:00OUT

<tbody>
</tbody>


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 :)
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Hi, something like this maybe:


Excel 2013
ABCDEFGH
1Employee # (C)Date (D)Start (E)End (F)Duration (G)Site (H)
2120425-Apr-167:15:00 AM8:45:00 AM01:30CCAC
3120425-Apr-169:00:00 AM12:00:00 PM03:00OUT00:15< Custom Formatted as [hh]:mm
4120427-Apr-1610:00:00 AM11:00:00 AM01:00OUT46:00
5120427-Apr-1612:00:00 PM1:00:00 PM01:00OUT01:00
6120428-Apr-1612:00:00 PM1:00:00 PM01:00OUT23:00
7120429-Apr-1610:00:00 AM11:00:00 AM01:00OUT21:00
8120429-Apr-1612:00:00 PM1:00:00 PM01:00OUT01:00
9120402-May-167:15:00 AM8:45:00 AM01:30CCAC66:15
10120402-May-169:00:00 AM12:00:00 PM03:00OUT00:15
11120404-May-1610:00:00 AM11:00:00 AM01:00OUT46:00
12120404-May-1612:00:00 PM1:00:00 PM01:00OUT01:00
13120406-May-1610:00:00 AM11:00:00 AM01:00OUT45:00
14120406-May-1612:00:00 PM1:00:00 PM01:00OUT01:00
Sheet1
Cell Formulas
RangeFormula
G3=(B3+C3)-(B2+D2)
 
Upvote 0
This is definitely a step in the right direction, thank you every much!
I've attached it to an IF statement to check against the dates as well and it's exactly what I need thank you very much.


For anyone else using this as a guide, it should be noted that I needed to Reformat my cells using the formula to have it display the HH:MM instead of a decimal.


Thanks again FormR
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,399
Latest member
alchavar

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