View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
[email protected] david-witts@lycos.co.uk is offline
external usenet poster
 
Posts: 3
Default Compare times : IF time < time2 then

Genius, thanks

this had me completely stuck. If you've got the time could you tell
me why it works?


Cell A2=30/11/1999 15:01:00

MOD(A2,1)=15:01:00 (formatted as time)

Regards

Davy
Pete_UK wrote:
Try this:

=IF(MOD(A2,1)<$C$1,"TRUE","FALSE")

assuming your date/time is in A2. If it is in the other cell, try this:

=IF(A2<MOD($C$1,1),"TRUE","FALSE")

Hope this helps.

Pete

wrote:
Hi,

I'm stuck on a comarison of times problem.

My time column is formatted as "dd/mm/yyyy hh:mm:ss" although the
cell is formatted as hh:mm:ss

I'd like a comparison to say if the time is less than say 14:00 then
TRUE else FALSE but a simple IF (A2<$C$1,"TRUE","FALSE") doesn't work.

cell C1 is 14:00:00 formatted as hh:mm:ss

A simple time subtraction works OK ie A2-C1

If I could get rid of the DATE part of the field then the comparison
works OK. Trying a RIGHT function to just put the time part in a column
by itself doesn't work.

Any ideas, as I'm stuck.

regards

Davy