Conditional Format a Work Schedule

I am needing to conditional format a work schedule. I would like to color different times to indicate different shifts. Basically I want to tell excel "If the start time = 7:00 AND the end time = 17:00 THEN color both cells a certain color".

Is there an easy (amateur) way to do this?
K TinAnalystAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Roy CoxGroup Finance ManagerCommented:
Please attach an example workbook
Rob HensonFinance AnalystCommented:
With your example only one of those time slots matches the 7:00 to 17:00 criteria.

What happens when the time slots don't match that specific time range?

Should it be start at/after 7:00 and finish at/before 17:00 = Day Shift?

Oscar S does 21:00 to 9:00 - presume this is a night shift.

At what point does a Night Shift start? eg Gabriel F does 15:00 to 0:00
K TinAnalystAuthor Commented:
Right, so I am sure I can change up the formula once I have a baseline formula Rob.

As a rule of thumb though, I would say night shift is from 0:00 to 8:00, C shift is from 15:00 to 0:00, Day shift is from 8:00 to 16:00.
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
To highlight the cells if the Start Time = 7:00 and End Time =17:00, select the range B7:AC34 and use the below formula to make a new rule for conditional formatting and set the format as per your choice.


Open in new window

Please notice that in Row6, all your Start headers had leading spaces and I removed them to make the above formula work properly.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
K TinAnalystAuthor Commented:
Awesome you have helped greatly!! I am still having an issue with midnight however. any idea why the timeframe from 15:00 to 0:00 isn't working?
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
For that time period, the formula should be as given below.
But the cells where you see the time values as 00:00:00 (e.g. in E14), if you click on any of those cells and look at the formula bar, you will find a date and time value 01/01/1900 00:00:00 which in fact is equivalent to 1 and you can confirm it by changing the format of those cells to General. 1 here is the first data in the calendar recognized by excel as excel treats dates as real numbers.
So make the following formula to work properly, all you need is, delete the date part from those cells and the formula will fine.


Open in new window

K TinAnalystAuthor Commented:
I saw the date was automatically inserted but I didn't even think about just deleting it.. duh! Thanks a bunch!
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
You're welcome! Glad I could help.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.