Condition formatting for overnight hours worked

k79mill

New Member
Joined
Jul 17, 2019
Messages
2
I'm trying to create a chart using conditional formatting that will show the hours that each employee is working. I have a formula for that works for Chris' time but can't figure out a formula that covers both Chris & Richard's schedule since Richard is working overnight. Richard's hours between 2200 hrs & 600 hrs need to be filled in with a color & Chris' hours need to be filled in also to show his hours.

SUN MON TUES WED THURS FRI SAT
28-Jul29-Jul30-Jul31-Jul1-Aug2-Aug3-Aug
STARTENDSTARTENDSTARTENDSTARTENDSTARTENDSTARTENDSTARTEND
RICHARD (RB)22006002200600220060022006002200600
CHRIS (CR)90017009001700900170090017009001700

<tbody>
</tbody>

DATE1002003004005006007008009001000110012001300140015001600170018001900200021002200

<tbody>
</tbody>
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
a date is an integer formatted to look like a date( where 1 = 1 Jan 1900 and every day after that is the next number in sequence)
time is a decimal formatted to look like time (0.25 = 6am, 0.5 = noon etc)

so to get time differences correct the numbers to be used in calculations must be the sum of date + time
- the date can be ignored if everything happens on the same day


a useful link
https://exceljet.net/formula/calculate-number-of-hours-between-two-times
 
Last edited:
Upvote 0
a date is an integer formatted to look like a date( where 1 = 1 Jan 1900 and every day after that is the next number in sequence)
time is a decimal formatted to look like time (0.25 = 6am, 0.5 = noon etc)

so to get time differences correct the numbers to be used in calculations must be the sum of date + time
- the date can be ignored if everything happens on the same day


a useful link
https://exceljet.net/formula/calculate-number-of-hours-between-two-times

sorry guess my post wasn't real clear. I know how to get it to figure the total hours. What I'm having trouble with is creating a gantt chart that would show their hours on duty. Ex: R works from 2200 hrs to 0600 hrs so I want the chart filled in with a specific color during those hours. TIA
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,256
Members
448,557
Latest member
richa mishra

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