DATE

Microsoft Office Excel 2003

See Also

Returns the sequential serial number that represents a particular date. If the cell format was General before the function was entered, the result is formatted as a date.

Syntax

DATE(year,month,day)

Year    The year argument can be one to four digits. Microsoft Excel interprets the year argument according to the date system you are using. By default, Excel for Windows uses the 1900 date system; Excel for the Macintosh uses the 1904 date system.

ShowFor the 1900 date system

  • If year is between 0 (zero) and 1899 (inclusive), Excel adds that value to 1900 to calculate the year. For example, DATE(108,1,2) returns January 2, 2008 (1900+108).

  • If year is between 1900 and 9999 (inclusive), Excel uses that value as the year. For example, DATE(2008,1,2) returns January 2, 2008.

  • If year is less than 0 or is 10000 or greater, Excel returns the #NUM! error value.

ShowFor the 1904 date system

  • If year is between 4 and 1899 (inclusive), Excel adds that value to 1900 to calculate the year. For example, DATE(108,1,2) returns January 2, 2008 (1900+108).

  • If year is between 1904 and 9999 (inclusive), Excel uses that value as the year. For example, DATE(2008,1,2) returns January 2, 2008.

  • If year is less than 4 or is 10000 or greater or if year is between 1900 and 1903 (inclusive), Excel returns the #NUM! error value.

Month    is a number representing the month of the year. If month is greater than 12, month adds that number of months to the first month in the year specified. For example, DATE(2008,14,2) returns the serial number representing February 2, 2009.

Day    is a number representing the day of the month. If day is greater than the number of days in the month specified, day adds that number of days to the first day in the month. For example, DATE(2008,1,35) returns the serial number representing February 4, 2008.

Remarks

  • Excel stores dates as sequential serial numbers so they can be used in calculations. By default, January 1, 1900 is serial number 1, and January 1, 2008 is serial number 39448 because it is 39,448 days after January 1, 1900. Excel for the Macintosh uses a different date system as its default.
  • The DATE function is most useful in formulas where year, month, and day are formulas, not constants.

Example

The example may be easier to understand if you copy it to a blank worksheet.

ShowHow?

  1. Create a blank workbook or worksheet.
  2. Select the example in the Help topic. Do not select the row or column headers.

    Selecting an example from Help

    Selecting an example from Help

  3. Press CTRL+C.
  4. In the worksheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Tools menu, point to Formula Auditing, and then click Formula Auditing Mode.
 
1
2
A B C
Year Month Day
2008 1 1
Formula Description (Result)
=DATE(A2,B2,C2) Serial date for the date above, using the 1900 date system (1/1/2008 or 39448)

Note  To view the number as a serial number, select the cell and click Cells on the Format menu. Click the Number tab, and then click General in the Category box.