Extract time for comparison

  • Thread starter Thread starter Steven
  • Start date Start date
S

Steven

How do you extract the time from a cell that has the function now() in it.
For example I have a cell in a worksheet that might be hardcoded with the
time 14:30 and then I want to take the current time of the day and see if it
is greater than 14:30. The problem I am having is that using the now()
function even if the time is 12:00 today then it will still think it is
greater than 14:30 which is incorrect when just comparing the time.

Thank you,

Steven
 
=now() includes both the date and time.

Maybe you could use:
=mod(now(),1)
(formatted as time)
to get the time (without the date).
 
Thank you Mr Peterson.

Dave Peterson said:
=now() includes both the date and time.

Maybe you could use:
=mod(now(),1)
(formatted as time)
to get the time (without the date).
 
Another alternative would be...

=NOW()-TODAY()

Rick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top