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.
The syntax for the DATE function in Excel is:
=DATE( year, month, day )
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 a valid date based on the year, month and day columns.
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:
=DATE(YEAR(TODAY()), MONTH(TODAY()), 1)
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:
=DATE(2019, 05, 15)+13
=DATE(2019, 07, 23)-20
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
Would you like to complete your daily work quickly and perfectly? Kutools for Excel brings 300 powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) and save 80% time for you.
- Designed for 1500 work scenarios, helps you solve 80% Excel problems.
- Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands.
- Become an Excel expert in 3 minutes. No longer need to remember any painful formulas and VBA codes.
- 30-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years.
- 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, Firefox, And New Internet Explorer.