Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If Statement

Status
Not open for further replies.

mind002

Technical User
Aug 31, 2001
1
US
How do I use a IF statement to verify if the data in a field is a date? :~/
 
The only way I know of is to check if the value is >32874 (1/1/1990) and <37257 (1/1/2002). The IF statement would be something like :

=IF(D2>32874,IF(D2<37257,&quot;OK&quot;,&quot;NO&quot;),&quot;NO&quot;)
 
mind002,

It really depends on how you entered data into a cell whether or not Excel treats it like a date. It is possible to enter a date in as a number or as a text value. Thus the existence of the datevalue function and the date functions.

If you provide further explanation as to why you want this perhaps we can help further.

Hope this helps.

 
bkpchs237 : If you enter as text, then in my book it's not a date. It's just text, and of less use than when entered as a date.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top