Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 389
Default Extract time for comparison

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Extract time for comparison

=now() includes both the date and time.

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

Steven wrote:

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


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 389
Default Extract time for comparison

Thank you Mr Peterson.

"Dave Peterson" wrote:

=now() includes both the date and time.

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

Steven wrote:

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


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Extract time for comparison

Another alternative would be...

=NOW()-TODAY()

Rick


"Dave Peterson" wrote in message
...
=now() includes both the date and time.

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

Steven wrote:

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


--

Dave Peterson


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
Time comparison problem Ray Batig Excel Programming 3 May 7th 07 12:01 AM
Time Comparison Charles in Iraq Excel Programming 1 October 14th 06 11:40 AM
Time comparison formula montagu Excel Discussion (Misc queries) 3 August 25th 05 03:37 PM
Time comparison Gixxer_J_97[_2_] Excel Programming 1 July 22nd 05 04:45 PM
Extract data after comparison fl Excel Programming 1 August 9th 04 06:10 PM


All times are GMT +1. The time now is 03:52 AM.

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"