DATEDIF

Formula Explanation

Calculate the number of days, months, or years between two dates.

Formula Syntax

Enter in the result column: DATEDIF(start_date, end_date, unit);
  • start_date:

    • Required: Represents the first or start date of the given period. Date values can be entered in various ways, including:
    • Text strings with quotes (e.g., "2001/1/30").
    • Serial numbers (e.g., 36921, which represents January 30, 2001, in the 1900 date system for Excel) or the results of other formulas or functions (e.g., DATEVALUE("2001/1/30")).
  • end_date:

    • Required: Represents the last (i.e., end) date of the time period.
  • unit:

    • Required: The type of information to return, where:

      • "Y" The number of complete years in the period.

      • "M" The number of complete months in the period.

      • "D" The number of days in the period.

      • "MD" The difference in days between the start date and end date, ignoring months and years.

      • "YM" The difference in months between the start date and end date, ignoring days and years.

      • "YD" The difference in days between the date parts of the start date and end date, ignoring years.

Usage Examples

Calculate the number of days between columns CI2 and CI3, and write the result into CI4

CI4 = datedif(CI2, CI3, "D")

datedif

Last Updated: