Conditional format based on current time in a cell

sknight0980

New Member
Joined
Nov 2, 2017
Messages
8
Hello,

Ive been searching to try and find the answer to my question below but unable to find anything that can help.

I have a spreadsheet with rows containing deliveries with a date and timestamp in the format 06/01/2022 05:58 on each row in column P. At the top of my sheet I have
VBA Code:
=NOW()
to show the current time.

What I would like to do is apply a conditional format to highlight each row which contains a date/time which is within 2 hours of the current time (at the top of the sheet) but struggling to make it work.

Any help is much appreciated.
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Hi,

Use below formula in Conditional Formatting. (See Image)

=$P$1-P2<=2/24
 

Attachments

  • Time Difference.png
    Time Difference.png
    57.7 KB · Views: 73
Upvote 0
Thank you so much for this answer, Saurabhj--I do so appreciate it! It is related to my question (posted 1/6/2022 at 5:21 p.m.), and although I cannot get it to answer my question for the specific concerns I had, I have used what you wrote here, made some modifications, and was able to make a work-around that will work. Thank you! I have been working on this for over five hours now, and so appreciate the direction here! Thanks again! :)
 
Upvote 0

Forum statistics

Threads
1,215,026
Messages
6,122,738
Members
449,094
Latest member
dsharae57

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