time value format

kelvin_9

Active Member
Joined
Mar 6, 2015
Messages
460
Office Version
  1. 2019
hi all, i would like to ask how can i amend my issue.

A1 is used to enter a time to color B1:B100 by conditional formatting which is greater than A1
i've manual changed the format both are "hh:mm", while i always get stuck in column B with format "date time" like "8/10/2019 20:15", thus i cant get the answer.

thanks all
 
Here the new formula to take of your full requirement
in B1 for the Conditional Format enter: =IF((B1-INT(B1))>($A$1-INT($A$1)),TRUE,FALSE)
The copy B1 and special past in B1:B17
If A1 = 20:20 it works
 
Last edited:
Upvote 0

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Here the new formula to take of your full requirement
in B1 for the Conditional Format enter: =IF((B1-INT(B1))>($A$1-INT($A$1)),TRUE,FALSE)
The copy B1 and special past in B1:B17
If A1 = 20:20 it works

thank you so much for your solution, appreciated PCL!
however i made a fault that what if it greater or equal, isnt it =IF((B1-INT(B1))>=($A$1-INT($A$1)),TRUE,FALSE)
 
Upvote 0
if it greater or equal, isnt it >=

YES
Ouf!!! We got it
What pleasant night to come
 
Last edited:
Upvote 0
Change your conditional formatting formula to

=ROUND($A$1-INT($A$1);11)<=ROUND($B1-INT($B1);11)

Looks like the times with dates aren't exactly the same as times without the dates when you dive deep enough into the decimals.
 
Upvote 0
OK there is some rounding issue with numbers when there "equal" but not entered in the same manner: date versus time
see next formula
=IF(TRUNC((B1-INT(B1)),3)>=TRUNC(($A$1-INT($A$1)),3),TRUE,FALSE)
 
Upvote 0
OK there is some rounding issue with numbers when there "equal" but not entered in the same manner: date versus time
see next formula
=IF(TRUNC((B1-INT(B1)),3)>=TRUNC(($A$1-INT($A$1)),3),TRUE,FALSE)
:rofl: when the time is less than column B 1min(or maybe more), like 20:44, it colored.
:eeek:
 
Upvote 0
Change your conditional formatting formula to

=ROUND($A$1-INT($A$1);11)<=ROUND($B1-INT($B1);11)

Looks like the times with dates aren't exactly the same as times without the dates when you dive deep enough into the decimals.

seems not working, it' pops error when click ok
 
Upvote 0
Oopsie: Forgot to change the formula to US settings. I'm using the Finnish ( / European ?) version where the delimiter between the parameters is ";". Replace them with commas and it should work:

=ROUND($A$1-INT($A$1),11)<=ROUND($B1-INT($B1),11)


I'm using 11 decimals here. That's a fraction of a second so in most of the cases something like 5 or 6 would be close enough (=roughly one second).
 
Upvote 0
when the time is less than column B 1min(or maybe more), like 20:44, it colored.No, there is no issue in my sample file ....!
Can you send yours ?
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,184
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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