View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
joeu2004 joeu2004 is offline
external usenet poster
 
Posts: 2,059
Default EXCEL time match

On May 6, 9:45*am, I wrote:
For "current time", you might write MOD(NOW(),1).
*It is better to put =MOD(NOW(),1) into a cell A1,
at least for testing purposes.

To compare to the minute, there are several ways.
*One way:
=IF(TEXT(A1,"hh:mm")=TEXT(D5,"hh:mm"),1,0)


Alternatively, put =--TEXT(NOW(),"hh:mm") into A1. Then the following
__should__ work:

=IF(A1=D5,1,0)

However, note that IF(A1-D5=0,1,0) might not work in some cases due to
floating-point issues.

The simpler form, IF(A1=D5,...), works because of the dubious
heuristic poorly described under the misleading title "Example When a
Value Reaches Zero" at http://support.microsoft.com/kb/78113 .