This function returns a date value based on adding an interval of time. It will be more clear by going through the following examples.
DateAdd ( interval , number, date )
This is a required argument. This is a string expression which specify the interval type but not the quantity. For example, Minute, second, hour, day etc. Below table has all the possible Interval types.
This is a required argument. This is the number of interval we want to add in the date time. This can be positive or negative. For future dates, positive and for past dates, negative values.
This is a required argument. This is date in which you want to add that interval.
|y||Day of year (same as Day)|
|w||Weekday (same as Day)|
You can use the DateAdd function to add or subtract a specified time interval from a date. For example, you can use DateAdd to calculate a date 2 Months from today or a time 30 minutes from now.
The DateAdd function won’t return an invalid date. The following example adds one month to January 31:
In this case, DateAdd returns 02-Jan-95.
My name is Vishwamitra Mishra. Friends Call me Vishwa. This blog is authored by me. I am an Excel Geek. Well, this blog talks a lot about my passion in Excels & Macros so I’ll not talk about it :) I am very much passionate about traveling & quite recently discovered that I am a good photographer too..:P
AND GET A FREE!
E-BOOK FOR EXCEL VBA BEGINNERS
DON'T MISS ANY NEW ARTICLE !
Get your FREE! E-Book & Have Every New Article Delivered Straight To Your Email-Box