condition based on time

JOEE1979

Active Member
Joined
Dec 18, 2022
Messages
250
Office Version
  1. 365
Platform
  1. Windows
Is there a way to make a conditional format to turn column F green if it is equal or less than the 1st part of column E, and same with column G being equal or greater than the 2nd part of column E?
Thanks

Book1
EFG
419:00 - 5:0018:39
55:00 - 13:004:3113:00
65:00 - 13:004:3413:00
Sheet1
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
You should split column E into two columns. The way you are showing it, it's text, so you have to use text functions to extract the time. Not a good design practice. Here's your solution but it's ugly:

$scratch.xlsm
EFG
419:00 - 5:0018:39
55:00 - 13:004:3113:00
65:00 - 13:004:3413:00
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
G4:G6Expression=G4>=TIMEVALUE(LEFT($E4,FIND(" ",$E4)-1))textNO
F4:F6Expression=F4<=TIMEVALUE(LEFT($E4,FIND(" ",$E4)-1))textNO


New and improved design:

$scratch.xlsm
EFGH
819:005:0018:39
95:0013:004:3113:00
105:0013:004:3413:00
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
H8:H10Expression=H8>=$F8textNO
G8:G10Expression=G8<=E8textNO
 
Upvote 0
Solution

Forum statistics

Threads
1,215,457
Messages
6,124,941
Members
449,197
Latest member
k_bs

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