conditional formatting with time range

kelvin_9

Active Member
Joined
Mar 6, 2015
Messages
444
Office Version
  1. 2019
hello all,

i'd like to use conditional formatting to identify my employee time range for easy reference
what should i do in the formula if i make a break down like, fill in yellow for who work before 11:00 and green for who work after 11:01?
NAMESUNDAYMONDAY
Peter11:30-21:00
Photo
12:30-22:00
HH-Zone B
Apple11:30-21:00
Photo
12:30-22:00
HH-Zone B
Mag10:30-20:00
HH-Zone B
09:00-18:30
HH


on the other contrary, can i fill in the colour in column_name for my request if only one day?
NAMESUNDAY
Peter11:30-21:00
Photo
Apple11:30-21:00
Photo
Mag10:30-20:00
HH-Zone B

thanks for the guidance
kelvin
 
Last edited:

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

I think that you will also need to clarify your question since we do not know exactly what your data means and at a quick look it would seem to me that the information below indicates that Mag worked both before and after.

1628056045680.png
 
Upvote 0
Hi Peter_SSs

apology for the confuse, hereunder i've made 2 sample for you all, the time range in the table below means the employee start time and end time
(for example, Peter on sunday, he works from 11:30 and off duty at 21:00)
sample 1, i would like to ask is it possible to set a formula in conditional formatting, fill in yellow for who work before 11:00 and green for who work after 11:01?
sample 2, if there is only one day, can i return the result on empolyee instead of the day.

sorry again for my bad language

Untitled.jpg


thanks for the guidance,
kelvin
(i will make sure the update on my account details when i get back home)
 
Upvote 0
i will make sure the update on my account details when i get back home

I suggest that you also investigate the following:
MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.

See if this does what you want.
I am a little unsure about the changeover around 11:00 as a strat time of 11:00 or 11:01 does not fit either of these descriptions
yellow for who work before 11:00 and green for who work after 11:01

21 08 04.xlsm
ABCD
1NAMESUNMON
2a11:30-21:0012:30-22:00
3b11:30-21:0009:30:21:00
4c10:30-20:0012:30-22:00
Start Time
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B2:B4Expression=AND(COUNTA($C$1:$F$1)=1,LEFT(C2,2)-11<0)textNO
C2:I4Expression=AND(COUNTA($C$1:$I$1)>1,LEFT(C2,2)-11<0)textNO
C2:I4Expression=AND(COUNTA($C$1:$I$1)>1,LEFT(C2,2)-11>=0)textNO
B2:B4Expression=AND(COUNTA($C$1:$F$1)=1,LEFT(C2,2)-11>=0)textNO
 
Upvote 0
You're welcome. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,868
Members
449,053
Latest member
Mesh

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