XL.DateAdd function: add years, months, days, hours, minutes to a date
XL.DateAdd function – Date and time function type – returns a date value which is a result of adding a specified time interval to a specified date.
The function helps you easily add years, quarters, months, days, minutes, hours and seconds to a date.
Before you begin, add Functions to Excel
Functions are one of the 20+ features within XLTools Add-in for Excel. Works in Excel 2019, 2016, 2013, 2010, desktop Office 365.
Download XLTools for Excel
Syntax
=XL.DateAdd(datepart, number, date)
Argument | Description |
---|---|
datepart [required] | Text expression representing the time interval you want to add:
|
number [required] | Number of intervals you want to add |
date [required] | An expression representing the date and time to which the interval should be added |
Examples [download]
Download this spreadsheet with examples and try the function yourself.
Download examples with this function (xlsx)
Formula | Description |
---|---|
=XL.DateAdd("Year", 2, TODAY()) | Returns the date which is today + 2 years |
=XL.DateAdd("Quarter", 2, TODAY()) | Returns the date which is today + 2 quarters |
=XL.DateAdd("Month", 2, TODAY()) | Returns the date which is today + 2 months |
=XL.DateAdd("Hour", 2, NOW()) | Returns the date and time which is now + 2 hours |
=XL.DateAdd("Minute", 120, NOW()) | Returns the date and time which is now + 120 minutes |
=XL.DateAdd("Second", 120, NOW()) | Returns the date and time which is now + 120 seconds |
=XL.DateAdd("Day", 20, A8) | Returns the date which is the date in cell A8 + 20 days |
Any questions or suggestions?