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
 

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

Similar Threads

Excel Message box with days of month & date. 1
Conditional formating 4
datediff 4
Date recalculates 1
date / time difference 7
Excel Vba to change displayed year automatically. 14
Excel Excel Show Countdown Date 7
Complicated Date Calculation needed 5

Back
Top