Leading the way in Microsoft Office Development
 Home|Excel|Word|PowerPoint|Consultancy|Feedback|Contact 
 Microsoft Excel > Functions > Date and Time > DATE

 

DATE(year, month, day)

 
 Returns the date as a serial number given the year, month and day.

 yearThe year component, between 0 and 9999.
 monthThe month component, between 1 and 12.
 dayThe day component between 1 and 31.

 REMARKS
 
  • If "year" >= 0 and "year" <= 1899 then "year" is added to 1900 to calculate the year.
     
  • If "year" >= 1900 and "year <= 9999 then that value is used as the year.
     
  • If "year" < 0, then #NUM! is returned.
     
  • If "year" > 10000, then #NUM! is returned.
     
  • If "month" > 12, then "month" is added to the first month in the given "year".
     
  • If "month" < 0, then #NUM! is returned.
     
  • If "day" > the number of days in "month", then "day" is added to the first day in the given "month".
     
  • If "day" < 0, then #NUM! is returned.
     
  • If the cell contains the General number format, then the format is automatically changed to "dd/mm/yyyy".
     
  • You can use the TEXT() function to convert a date serial number into a particular date format.

     EXAMPLES
     
     A
    1=DATE(1977,7,1) = 28307
    2=DATE(2003,12,1) = 37956
    3=DATE(2004,15,2) = 02/03/2005
    4=DATE(2005,3,2) = 02/03/2005
    5=DATE(1,1,2) = 02/01/1901
    6=DATE(100,1,2) = 02/01/2000
    7=DATE(1900,1,2) = 01/01/1900
    8=DATE(2000,1,2) = 02/01/2000
    9=DATE(2003,10,40) = 09/11/2003
    10=DATE(0,10,40) = 09/11/1900
    11=DATE(0,11,9) = 09/11/1900
    12=TEXT(DATE(2003,11,9),"ddd-mmm-yy") = Sun-Nov-03
    13=DATE(-2,7,1) = #NUM!
     

     Functions - D | Index - D | Dates & Times | Office Online 

     Copyright © 2004-2007 Better Solutions Limited. All Rights Reserved.Top