# Highlight a timestamp if within a time of another timestamp

#### Paul365

##### New Member
Hello,

I am trying to conditional format a spread sheet with time stamps on it. I am looking to have...
Start time 'Cell A1'and in Cell A2 and A3 some other time stamps with different times.
I would like all cells except A1 to highlight different colors if they are within a certain time of A1
example: A1 12:05 PM
- If the other cells times are under 1 hour of A1, I would like them to turn green,
- If the other cells are between 1 and 2 hours of A1 to turn Orange
- If the other cells are 2+ hours of A1 to turn Red.

I have looked up so many website and all I get is formula's with dates or the current time, not a previous time.

If anyone can help would be much appreciated

Thanks

### Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Welcome to the MrExcel forum!

Start by formatting A2 and A3 with a green fill color. Then set up your Conditional Formatting like this:

Book1
A
112:05 PM
210:55 AM
32:24 PM
Sheet4
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:A3Expression=ABS(\$A\$1-A2)>2/24textNO
A2:A3Expression=ABS(\$A\$1-A2)>1/24textNO

Welcome to the MrExcel forum!

Start by formatting A2 and A3 with a green fill color. Then set up your Conditional Formatting like this:

Book1
A
112:05 PM
210:55 AM
32:24 PM
Sheet4
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:A3Expression=ABS(\$A\$1-A2)>2/24textNO
A2:A3Expression=ABS(\$A\$1-A2)>1/24textNO
This is perfect, Thankyou so much

Replies
1
Views
50
Replies
1
Views
324
Replies
7
Views
151
Replies
6
Views
422
Replies
6
Views
322

1,218,494
Messages
6,142,811
Members
450,448
Latest member
CoffeeCup

### 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.

### Which adblocker are you using?

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

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