Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Time comparison problem | Excel Programming | |||
Time Comparison | Excel Programming | |||
Time comparison formula | Excel Discussion (Misc queries) | |||
Time comparison | Excel Programming | |||
Extract data after comparison | Excel Programming |