Conditional formatting for elapsed time

Eqwizzle

New Member
Joined
Oct 16, 2024
Messages
8
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
Platform
  1. Windows
  2. Web
I am wanting a formula that will color code the cells depending on the value which is elapsed time. I would like for the cell to turn red if past 24hrs, orange if past 10hrs, yellow if past 5hrs, and blue if past 1hr. I tried the formula =H2 > Time(24,0,0), H2 <> “”. But that formula isn’t functioning how I would like.

New to excel and I am a novice just learning from various online tutorials.
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Red:
Code:
=H2>1
Orange
Code:
=H2>10/24
Yellow
Code:
=H2>5/24
Blue
Code:
=H2>1/24

Drag and drop to arrange the rules in the following order:
  1. Red Rule
  2. Orange Rule
  3. Yellow Rule
  4. Green Rule

Note on "Stop If True"​

For each rule, check the Stop If True box
Explanation:
Rule order is very important because Excel will evaluate the rules from top to bottom. If a rule is met, Excel will not evaluate the rules below (if "Stop If True" is checked).
This means that if cell H2 is greater than 1, the cell will be colored Red and the other rules will not be evaluated.
 
Upvote 0
Red:
Code:
=H2>1
Orange
Code:
=H2>10/24
Yellow
Code:
=H2>5/24
Blue
Code:
=H2>1/24

Drag and drop to arrange the rules in the following order:
  1. Red Rule
  2. Orange Rule
  3. Yellow Rule
  4. Green Rule

Note on "Stop If True"​

For each rule, check the Stop If True box
Explanation:
Rule order is very important because Excel will evaluate the rules from top to bottom. If a rule is met, Excel will not evaluate the rules below (if "Stop If True" is checked).
This means that if cell H2 is greater than 1, the cell will be colored Red and the other rules will not be evaluated.
I followed the instructions and it turned my entire column red. I would like for the rules to only apply if there is a value within the cell. I also left stop if true unchecked for each rule.
 
Upvote 0
I followed the instructions and it turned my entire column red. I would like for the rules to only apply if there is a value within the cell. I also left stop if true unchecked for each rule.
Hmm, may be cell contains textstring that always >0
Try:
=H2-1>0

Or
Your date are not real date-time, but date-time_stores_as string
???

Could you share file via gg drive, or an image at least?
 
Upvote 0
Hmm, may be cell contains textstring that always >0
Try:
=H2-1>0

Or
Your date are not real date-time, but date-time_stores_as string
???

Could you share file via gg drive, or an image at least?
 

Attachments

  • IMG_2295.jpeg
    IMG_2295.jpeg
    92.3 KB · Views: 10
Upvote 0
If you are sharing images, please don't take pictures with your phone/camera and share those. Those are extremely difficult to read.
Take a screen shot with the Snipping Tool or some other program like that, and share that instead.
 
Upvote 0
If you are sharing images, please don't take pictures with your phone/camera and share those. Those are extremely difficult to read.
Take a screen shot with the Snipping Tool or some other program like that, and share that instead.
Will do. Thanks I forgot about the snipping tool.
 
Upvote 0
I have now added an updated image using Windows snipping tool. Please provide any help and if you need more than one image, please let me know. Thanks.
 

Attachments

  • spilltrackersnap.png
    spilltrackersnap.png
    38.7 KB · Views: 4
Upvote 0
Is your worksheet currently in formula displaying mode?
Please adjust it so that we can see the results as well as the cell colors
 
Upvote 0
Is your worksheet currently in formula displaying mode?
Please adjust it so that we can see the results as well as the cell colors
Yes, my formulas were displayed. I have updated this post with several images. I adjusted the date and time to illustrate the issue. The cell should not be in the color of red but blue because it is a duration of equal to greater than an hour.
 

Attachments

  • Screenshot 2024-10-18 001148.jpg
    Screenshot 2024-10-18 001148.jpg
    218.4 KB · Views: 5
  • Screenshot 2024-10-18 001210.jpg
    Screenshot 2024-10-18 001210.jpg
    217.4 KB · Views: 4
  • Screenshot 2024-10-18 001256.jpg
    Screenshot 2024-10-18 001256.jpg
    121.2 KB · Views: 5
  • Screenshot 2024-10-18 011351.jpg
    Screenshot 2024-10-18 011351.jpg
    121 KB · Views: 5
Upvote 0

Forum statistics

Threads
1,224,822
Messages
6,181,164
Members
453,021
Latest member
Justyna P

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