The information in this article applies to:
SUMMARYWhen comparing dates, either the serial number for the date or the DateValue function must be used. MORE INFORMATIONExampleA1: 2/15/91 B1: =IF(A1=2/15/91,TRUE,FALSE)If you type the above entries into a worksheet, B1 will return FALSE. Excel treats the date in the IF statement as a calculation and actually divides the numbers. For example, 2/15/91=.001465 is the result of dividing 2 by 15 and dividing the result by 91. The DateValue function returns the serial number of a given date (in text form). Applying the DateValue function to the date in the IF statement will achieve the desired result:
B1 now returns TRUE. The actual serial date can also be substituted for the DateValue function. REFERENCES
"Microsoft Excel Function Reference." Version 3.00, pages 45, 125,
129.
Additional query words: 2.00 2.0 2.01 2.1 2.10 2.2 2.21 2.20 3.0
Keywords : |
Last Reviewed: March 21, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |