๐ More functions: see the Formula function reference.DATEDIF computes the difference between two dates in AI Table โ return the result in years, months, or days. Fits scenarios that need precise date math.
1 Basics
Syntax
- start_date: starting date.
- end_date: ending date.
- unit: time unit for the return value:
- โYโ: full years between the dates.
- โMโ: full months between the dates.
- โDโ: days between the dates.
- โMDโ: ignore year and month โ days only.
- โYMโ: ignore year โ months only.
- โYDโ: ignore year โ days only.
Examples
Two date fields: [Start date], [End date].Example 1: full years between two dates
Example 2: days between two dates
2 Scenario examples
2.1 Cycle time
Compute the gap between [Dispatched at] and [Executed at] to gauge the storeโs response speed.2.2 Days remaining
Compute days between [Check date] and today for planning.formula
3 FAQ
- Q: DATEDIF returns โ#ERROR!โ โ whatโs wrong? A: Check whether end date is earlier than start date. If so, computation errors or returns negative values.