Add-ons
Check out the store for many more
Add-on

Date Add and Subtract


(81)
31,887 users

Overview

Provides two custom functions for easily adding and subtracting time from a date value.
Examples:

Adds 3 months to the date in cell A1.
=DATEADD(A1, "months", 3)

Subtracts 12 weeks from the date in cell A1.
=DATESUBTRACT(A1, "w", 12)

Adds 2 days to the dates in the range A1:A10.
=DATEADD(A1:A10, "day", 2)

This add-on was created as a sample for other developers to learn from. The complete Apps Script source code is available here: https://github.com/google/google-apps-script-samples/tree/master/date_add_and_subtract

Details

Version: 7
Updated: November 19, 2015
Language: English