#1   Report Post  
Michael Link
 
Posts: n/a
Default Operators With Times

I have a cell (call it A1) containing a date/time stamp of the format =
mm/dd/
yy hh:mm AM/PM. I'm trying to conditionally format a second cell so that =
it=20
turns yellow when the time in the first cell is after (say) 12 noon. In =
the=20
conditional formatting box for the second cell I've tried entering the =
formula

=3DA1"12:00"

but the format never kicks in. I thought maybe there was an issue with =
the=20
date/time formatting in A1 (you know, that maybe the conditional=20
formatting formula might work if A1 contained ONLY a time), but=20
reformatting A1 to show only a time didn't help either. (And in any =
event, A1=20
really needs to have the format I've mentioned.)=20

Does anyone know if the usual <,,=3D operators simply don't work with=20
times? If so, might there be any workarounds? Thanks!
  #2   Report Post  
Niek Otten
 
Posts: n/a
Default

You can leave the date out of the formatting, but it is still in the cell
value.

Time is stored as a fraction of a day. So 12:00 is 0.5
In your conditional format, enter the formula:

=MOD(A1,1)0.5

For other times it is probably easier to enter them in a cell and use that
cell to compare with.

--

Kind Regards,

Niek Otten

Microsoft MVP - Excel

"Michael Link" wrote in message
...
I have a cell (call it A1) containing a date/time stamp of the format mm/dd/
yy hh:mm AM/PM. I'm trying to conditionally format a second cell so that it
turns yellow when the time in the first cell is after (say) 12 noon. In the
conditional formatting box for the second cell I've tried entering the
formula

=A1"12:00"

but the format never kicks in. I thought maybe there was an issue with the
date/time formatting in A1 (you know, that maybe the conditional
formatting formula might work if A1 contained ONLY a time), but
reformatting A1 to show only a time didn't help either. (And in any event,
A1
really needs to have the format I've mentioned.)

Does anyone know if the usual <,,= operators simply don't work with
times? If so, might there be any workarounds? Thanks!


  #3   Report Post  
Michael Link
 
Posts: n/a
Default

Thanks, Nick--I'll try the formula you've suggested!=20
-----Original Message-----
You can leave the date out of the formatting, but it is still in the =

cell=20
value.

Time is stored as a fraction of a day. So 12:00 is 0.5
In your conditional format, enter the formula:

=3DMOD(A1,1)0.5

For other times it is probably easier to enter them in a cell and use =

that=20
cell to compare with.

--=20

Kind Regards,

Niek Otten

Microsoft MVP - Excel

"Michael Link" wrote in message=20
...
I have a cell (call it A1) containing a date/time stamp of the format =

mm/
dd/
yy hh:mm AM/PM. I'm trying to conditionally format a second cell so =

that it
turns yellow when the time in the first cell is after (say) 12 noon. In =

the
conditional formatting box for the second cell I've tried entering the=20
formula

=3DA1"12:00"

but the format never kicks in. I thought maybe there was an issue with =

the
date/time formatting in A1 (you know, that maybe the conditional
formatting formula might work if A1 contained ONLY a time), but
reformatting A1 to show only a time didn't help either. (And in any =

event,=20
A1
really needs to have the format I've mentioned.)

Does anyone know if the usual <,,=3D operators simply don't work with
times? If so, might there be any workarounds? Thanks!=20


.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy from worksheet to another x times Union70 Excel Discussion (Misc queries) 0 March 7th 05 09:03 PM
If I have data for varying times in a column chart, how do I space tc1967uk Charts and Charting in Excel 1 February 22nd 05 06:03 PM
Formula for averaging times Denise Excel Discussion (Misc queries) 1 January 28th 05 04:05 PM
SUMPRODUCT ON TIMES Bob Phillips Excel Worksheet Functions 1 January 13th 05 05:28 PM
Adding/Averaging Times in Excel JD Excel Discussion (Misc queries) 2 January 5th 05 05:07 PM


All times are GMT +1. The time now is 10:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"