Excel - DATE Function



DATE Function

The Excel DATE function retrieves the date serial number depending on the given inputs. This function's main functionality is to generate dates quickly in a specific date format and perfectly manage leap years. You can seamlessly use the DATE function with other functions like EOMONTH, TODAY, WEEKDAY, etc. For example, to identify the peak periods when an incident occurred in a month, you can merge the MONTH function with the DATE function to determine the incident month.

Compatibility

This advanced Excel function is compatible with the following versions of MS-Excel

  • Excel for Microsoft 365
  • Excel for Microsoft 365 for Mac
  • Excel for the web
  • Excel 2024
  • Excel 2024 for Mac
  • Excel 2021
  • Excel 2021 for Mac
  • Excel 2019
  • Excel 2016
  • Excel 2013
  • Excel 2010
  • Excel 2007

Syntax

The syntax of the DATE function is as follows −

=DATE(year, month, day)

Arguments

You can use the following arguments with the DATE function −

Argument Description Required / Optional
Year This argument may contain one to four digits.

By default, Microsoft Excel for Windows uses the 1900 date system.

Required
Month It indicates a positive or negative integer specifying the month from 1 to 12 (January to December). Required
Day It denotes a positive or negative integer that indicates the specific day number between 1 and 31. Required

Points to Remember

  • In Microsoft Excel, Dates are stored as serial numbers that ease the analyst's use in complex calculations. By default, serial number 1 indicates January 1, 1900, and serial number 40990 indicates March 3, 2012.
  • If the text value is specified in any arguments, then the DATE function will retrieve the #VALUE! error.

year

Microsoft prefers to use four digits for the year argument to facilitate better understanding. For example, "09" is assumed to be "1909" or "2009."

  • If the year argument lies between 0 and 1899 (including), that value will be added to 1900 to compute the year value. For instance, DATE (112, 9, 2) returns September 2, 2008 (1900+112)
  • If the year argument lies between 1900 and 9999 (inclusive), then that four-digit value will be used as the year. For example, DATE (1998, 10, 4) returns October 4, 1998
  • If the year argument is smaller than 0 or is 10000 or greater, then the DATE function will retrieve the #NUM! Error.

month

  • If month argument is larger than 12, it would be added to the first month in the year specified. For instance, DATE (2008, 16, 12) returns the date serial number indicating April 12, 2009
  • If the month argument is smaller than 1 or equal to zero, then the Excel tool will subtract the month’s magnitude, plus 1, from the starting month of the given year. For instance, DATE (2010,-4, 14) retrieve the date serial number indicating August 14, 2008

day

  • If the day argument is larger than the number of days in the month specified, day adds that number of days to the first day of the specified month. For example, DATE (2008, 1, 35) returns the serial number representing February 4, 2008.
  • If the day argument contains a number less than 1, then the Excel tool would subtract the magnitude of that number of days, plus one, from the first day of the given month. For example, DATE (2008, 1, -15) returns the serial number, representing December 16, 2007.

Example of DATE Function in Excel

This example demonstrates creating a new date by employing the Date formula, specifying the distinct values for the day, month, and year.

Solution

Step 1 − First, assume the sample dataset with the Day, Month, and YEAR values described in the B, C, and D columns.

How to use the DATE Formula in Excel1

Step 2 − After that, select the cell range E2:E4 and write the formula =DATE(D2,C2,B2).

How to use the DATE Formula in Excel2

Step 3 − After that, press the "Ctrl+Enter" to display the resulting value.

How to use the DATE Formula in Excel3

Therefore, the DATE function returns the dates in the dd/mm/yyyy format. If you wish to change the date format, then you can choose the specific date format from the Date category in the Format cells.

Download Practice Sheet

You can download and use the sample data sheet to practice the DATE function.

Advertisements