Conditinal Formatting Hours of Service

%3CLINGO-SUB%20id%3D%22lingo-sub-1506246%22%20slang%3D%22en-US%22%3EConditinal%20Formatting%20Hours%20of%20Service%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1506246%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20All%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3BI%20have%20attached%20my%20excel%20workbook%20that%20I%20am%20looking%20for%20assistance%20on%3B%20I%20need%20to%20have%20excel%20highlight%2F%20color%20the%20cell%20when%20a%20shift%20%23%20is%20typed%20in%20that%20starts%20less%20than%208%20hours%20from%20the%20end%20of%20the%20previous%20day%20shift.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3BIe%20Driver%20a%20works%20shift%2023%20Monday%20this%20shift%20ends%20at%202%3A00A%20M%20on%20Tuesday%20morning%2C%20if%20I%20type%20in%20Shift%201%20on%20Tuesday%20it%20starts%20at%204%3A33AM%3B%20therefore%20there%20is%20less%20than%208%20hours%20off%20between%20the%20end%20and%20start%20times.%20I%20need%20the%20Tuesday%20cell%20to%20highlight.%20I%20have%20used%20lookup%20functions%20to%20populate%20the%20start%20and%20end%20times%20for%20the%20shifts%20but%20cannot%20figure%20out%20how%20to%20conditional%20format%20the%20table%20using%20data%20from%20another%20table.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3BAny%20help%20would%20be%20appreciated%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1506246%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
New Contributor

Hi All,

 

 I have attached my excel workbook that I am looking for assistance on; I need to have excel highlight/ color the cell when a shift # is typed in that starts less than 8 hours from the end of the previous day shift.

 

 Ie Driver a works shift 23 Monday this shift ends at 2:00A M on Tuesday morning, if I type in Shift 1 on Tuesday it starts at 4:33AM; therefore there is less than 8 hours off between the end and start times. I need the Tuesday cell to highlight. I have used lookup functions to populate the start and end times for the shifts but cannot figure out how to conditional format the table using data from another table.

 

 Any help would be appreciated

3 Replies
Highlighted

@EmjBCPWT  i assume it is the table on 'PT template' in rows 21:36 that you need this formatting.  Here is the custom formatting -> custom formula I applied to the range B23:O36 (the range is important because the formula is all based off the upper left corner cell of that applied range):

 

=AND(B$22="Start",(B23+1-A23)<1/3)

 

  see attached.

Note: this is also based on the way you defined your end times that carry over a day actually being +1 day.  i.e. your example of a shift ending at 2:00 AM the next day is actually stored as the next day and not just the time of 2:00 AM.  So if you change or add additional shifts you must maintain that convention.

Highlighted

@EmjBCPWT 

 

You'd help others help you if you could be a bit more explicit or descriptive here. What you have is a relatively complex spreadsheet (it may not appear so to you because you created it and therefore KNOW personally all the relationships between tabs and tables and cells).

 

So if you could point to the cell(s) in question rather than just assuming it's obvious, it would save a lot of time.

 

That said, I am noticing that although the "Run Times" table has times noted, with I think only two exceptions, there are no dates associated with those times. I do believe the calculation for the "less than 8 hours" condition would be a lot more reliable if the cells in question contained both date and time, even if only the time were to be displayed. And that might well solve your problem.
"

Highlighted

@mtarler Thank you so much!! I was trying to use an IF formula and just could not get it to work! You are a life saver!