Formula works - convert to conditional format

Luke777

Board Regular
Joined
Aug 10, 2020
Messages
246
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I'm experimenting with the following formula

Excel Formula:
=IF(AND(H15>H17,H15<I17),"YES","NO")

H15 contains the current time using
Excel Formula:
=TIME(HOUR(NOW()),MINUTE(NOW()),SECOND(NOW()))

H17 and I17 contain two times.

The first formula gives me a yes/no depending on if the current time is between the two specified times.

If I want to then highlight the cell RED using conditional formatting if the answer is YES, how do I do that?

Basically I'm not sure how to transfer the logic of the formula I've used to something Conditional Formatting can understand correctly.

I've tried removing the IF and the AND in various combinations but it doesn't seem to work.

I'm sure the solution is simple, but Conditional Formatting has always been my weakness I'm afraid

Thanks!
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Maybe...
Excel Formula:
=AND(H15>H17,H15<I17)
in the Conditional format rule

Book1
GHIJ
12YES
13
14
151:39 PM
16
1712:3414:02
Sheet3
Cell Formulas
RangeFormula
J12J12=IF(AND(H15>H17,H15<I17),"YES","NO")
H15H15=TIME(HOUR(NOW()),MINUTE(NOW()),SECOND(NOW()))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
H15Expression=AND(H15>H17,H15<I17)textNO


Book1
GHIJ
12NO
13
14
151:40 PM
16
1712:3413:02
Sheet3
Cell Formulas
RangeFormula
J12J12=IF(AND(H15>H17,H15<I17),"YES","NO")
H15H15=TIME(HOUR(NOW()),MINUTE(NOW()),SECOND(NOW()))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
H15Expression=AND(H15>H17,H15<I17)textNO
 
Upvote 0
Solution
Maybe...
Excel Formula:
=AND(H15>H17,H15<I17)
in the Conditional format rule

Book1
GHIJ
12YES
13
14
151:39 PM
16
1712:3414:02
Sheet3
Cell Formulas
RangeFormula
J12J12=IF(AND(H15>H17,H15<I17),"YES","NO")
H15H15=TIME(HOUR(NOW()),MINUTE(NOW()),SECOND(NOW()))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
H15Expression=AND(H15>H17,H15<I17)textNO


Book1
GHIJ
12NO
13
14
151:40 PM
16
1712:3413:02
Sheet3
Cell Formulas
RangeFormula
J12J12=IF(AND(H15>H17,H15<I17),"YES","NO")
H15H15=TIME(HOUR(NOW()),MINUTE(NOW()),SECOND(NOW()))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
H15Expression=AND(H15>H17,H15<I17)textNO
Thanks for that :)
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,262
Members
449,075
Latest member
staticfluids

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