Excel Date function
In Excel workbook, the DATE function can help us to combine year, month and day numbers from separate cells to a valid date.
Syntax:
The syntax for the DATE function in Excel is:
Arguments:
year – A number is between 1 and 4-digits number that indicates the year number.
- If year is between 0 and 1900, Excel will add 1900 to the year automatically.
- If year is between 1900 and 9999, the value will be used as the year value.
month - A number indicates the month value. (From 1 to 12 normally)
- If month is greater than 12, Excel will add the number of months to the first month of the specified year. For example, DATE(2018,14,2) will return the date 2/2/2019.
- If month is less than 1, Excel will subtract the absolute value of month plus 1 from the first month of the specified year. For example, DATE(2018,-4,15) will return the date 8/15/2017.
day - A number indicates the day value. (From 1 to 31 normally)
- If day is greater than the number of days in the specified month, Excel will add that number of days to the first day of the month. For example, DATE(2018,1,35) will return the date 2/4/2018.
- If day is less than 1, Excel will subtract the absolute value of day plus 1 from the first day of the month specified. For example, DATE(2018,9,-10) will return the date 8/21/2018.
Return:
Return a valid date based on the year, month and day columns.
Examples:
Here are some DATE formula examples in Excel:
Example 1: Use DATE function to combine year, month and day numbers to return a valid date:
Enter or copy the below formula into a blank cell where you want to get the result, and then drag the fill handle down to the cells you need to fill this formula, see screenshot:
Note: A2, B2, C2 are the cells contain the year, month and day numbers separately.
Example 2: Use DATE function to return the first day of the current year and month:
Enter or copy the following formula into a blank cell, and then press Enter key, and the first day of the current year and month is returned, see screenshot:
Example 3: Use DATE function to add or subtract a number of days to a specific date:
Use this formula: =DATE(year, month, day)+days or =DATE(year, month, day)-days, please specify the year, month and day number to your own, such as:
Relative DATE articles:
How To Calculate Retirement Date From Date Of Birth In Excel?
How To Calculate End Date From Start Date And Duration In Excel?
How To Convert Yyyymmdd To Normal Date Format In Excel?
How To Combine Three Cells To Create Date In Excel?
The Best Office Productivity Tools
Kutools for Excel - Helps You To Stand Out From Crowd
Kutools for Excel Boasts Over 300 Features, Ensuring That What You Need is Just A Click Away...
Office Tab - Enable Tabbed Reading and Editing in Microsoft Office (include Excel)
- One second to switch between dozens of open documents!
- Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
- Increases your productivity by 50% when viewing and editing multiple documents.
- Brings Efficient Tabs to Office (include Excel), Just Like Chrome, Edge and Firefox.