Google Sheets - DATEDIF function

DATEDIF calculates the length of time between two dates. For example, given birth date of a people, we can calculate the ages as of today.

Syntax

DATEDIF(start_date, end_date, unit)

Example


Notes

  • Use "MD" as unit to calculate the number of days after subtracting the whole months.
  • Use "YM" as unit to calculate the number of months after subtracting the whole years.
  • Use "YD" to calculate the number of days between two dates as if they are in the same year. For example, DATEDIF("2/3/2008", "2/19/2020", "YD") will return 16.

Comments

Popular posts from this blog

Excel - IF function

Excel - VLOOKUP function

Excel - Hierarchical chart (Treemap)