Skip to main content
๐Ÿ“Œ 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

DATEDIF([start_date], [end_date], unit)
  • 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

=DATEDIF([Start date], [End date], "Y")

Example 2: days between two dates

=DATEDIF([Start date], [End date], "D")

2 Scenario examples

2.1 Cycle time

Compute the gap between [Dispatched at] and [Executed at] to gauge the storeโ€™s response speed.
DATEDIF([Dispatched at],[Executed at],"D")

2.2 Days remaining

Compute days between [Check date] and today for planning.
formula
DATEDIF(TODAY(),[Check date],"D")

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.