Date problem

  • Thread starter Thread starter q5
  • Start date Start date
Q

q5

I have a table of dates. I want to set a "flag" when Today() is one of
those dates. I am doing a comparison of the table date with the result of
the Today() function, but it is not working. I suspect it has something to
do with the way that dates are stored, but I am not sure.

Example: Suppose my dates are stored in $A$2 thru $A$6. The value of
today's date is stored in $A$1 using the Today() function. In column B I do
the comparison: =If($A2=$A$1,True,False)

I do not get "True" even when the dates are the same. Can anyone give me an
idea of what the problem is? (I've tried reformatting the cells as Date,
Text and Number and none of those changes fix the problem).

Thanks.
 
can you give a sample of the dates. Have you checked the formats dd/mm/yy or
mm/dd/yy. Are you sure the dates are not plain texts. To check this, change
the format to general and you should see a number and not text.

Mangesh
 
Try:

=IF(DATEVALUE($A2)=$A$1,TRUE,FALSE)

This will convert a string value in cells A2 to a date.

HTH,
Bernie
MS Excel MVP
 
That did the trick. Thanks.


Bernie Deitrick said:
Try:

=IF(DATEVALUE($A2)=$A$1,TRUE,FALSE)

This will convert a string value in cells A2 to a date.

HTH,
Bernie
MS Excel MVP
 
Back
Top