Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy from worksheet to another x times | Excel Discussion (Misc queries) | |||
If I have data for varying times in a column chart, how do I space | Charts and Charting in Excel | |||
Formula for averaging times | Excel Discussion (Misc queries) | |||
SUMPRODUCT ON TIMES | Excel Worksheet Functions | |||
Adding/Averaging Times in Excel | Excel Discussion (Misc queries) |