Anda di halaman 1dari 4

Description

The DATE function returns the sequential serial number that represents a particular date. For example, the formula
=DATE(2008,7,8)
returns 39637, the serial number that represents 7/8/2008.
NOTE If the cell format was General before the function was entered, the result is formatted as a date instead of a
number. If you want to view the serial number, or if you want to change the formatting of the date, select a different
number format in the Number group of the Home tab.
The DATE function is most useful in situations where the year, month, and day are supplied by formulas or cell
references. For example, you might have a worksheet that contains dates in a format that Excel does not recognize,
such as YYYYMMDD. You can use the DATE function in conjunction with other functions to convert the dates to a
serial number that Excel recognizes. See the table in the Example section of this article for more information.
Syntax
DATE(year, month, day)
The DATE function syntax has the following arguments:
year Required. The value of the year argument can include one to four digits. Excel interprets the year
argument according to the date system your computer is using. By default, Microsoft Excel for Windows uses
the 1900 date system; Microsoft Excel for the Macintosh uses the 1904 date system.
TIP We recommend using four digits for the year argument to prevent unwanted results. For example, using
"07" returns "1907" as the year value.
How does Excel for Windows work with 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.
How does Excel for the Macintosh work with 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 Required. A positive or negative integer representing the month of the year from 1 to 12 (January to
December).
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.
If month is less than 1, month subtracts the magnitude of that number of months, plus 1, from the first
month in the year specified. For example,
DATE(2008,-3,2)
returns the serial number representing September 2, 2007.
day Required. A positive or negative integer representing the day of the month from 1 to 31.
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.
If day is less than 1, day subtracts the magnitude that number of days, plus one, from the first day of
the month specified. For example,
DATE(2008,1,-15)
returns the serial number representing December 16, 2007.
NOTES
NOTE Excel stores dates as sequential serial numbers so that 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,447 days after January 1,
1900. Microsoft Excel for the Macintosh uses a different date system as its default.
For more information, see Change the date system, format, or two-digit year interpretation.
Example
The example may be easier to understand if you copy it to a blank worksheet.
How do I copy an example?
1. Select the example in this article.
IMPORTANT Do not select the row or column headers.

Selecting an example from Help
2. Press CTRL+C.
3. In Excel, create a blank workbook or worksheet.
4. In the worksheet, select cell A1, and press CTRL+V.
IMPORTANT For the example to work properly, you must paste it into cell A1 of the worksheet.
5. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave
accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.
A B C
1
2
3
4
5




6




7



S

Year Month Day
2008 1 1
Data
20081125
Formula Description Result
=DATE(A2,B2,C2) Serial date for the date derived by using
cells A2, B2, and C2 as the arguments for
the DATE function, and using the 1900
date system.
1f1f2008 or 39++8
=DATE(YEAR(TODAY()),12,31) Serial date for the last day of the current
year.
12f31fnnnn or the equivalent
sequential serial number
(actual value depends on
current year)
=DATE(LEFT(A+,+),N!D(A+,5,2),
R!GHT(A+,2))
A formula that converts a date from the
YYYYNNDD format to a serial date.
11f25f2008 or 39777

NOTE To view the number as a serial number, select the cell and then, on the Sheet tab, in the Number group, click
the arrow next to Number Format, and then click Number.

Anda mungkin juga menyukai