📌 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.