Table of Contents
To calculate the difference between two dates in Google Sheets, use the ‘=DATEDIF’ function. This function takes three parameters: start date, end date, and unit type (days, months, or years). The DATEDIF function will return the difference between the two dates in the specified unit type. To calculate the difference between two dates in another unit type, divide the result by the appropriate number of days, months, or years.
We can use the DATEDIF() function to calculate the difference between two dates in Google Sheets.
This function uses the following syntax:
=DATEDIF(start_date, end_date, unit)
where:
- start_date: The start date
- end_date: The end date
- unit: Unit of time to use (“Y”, “M”, “D” for years, months, dates)
The following examples show how to use this function to calculate the difference between two dates in Google Sheets.
Example 1: Difference in Days
The following image shows how to calculate the difference (in days) between two dates:
This tells us that there are 1,127 full days between 1/1/2018 and 2/1/2021.
Example 2: Difference in Months
The following image shows how to calculate the difference (in months) between two dates:
Example 3: Difference in Years
The following image shows how to calculate the difference (in years) between two dates:
Example 4: Difference in Years & Months
The difference between the start and end dates is 3 years and 1 month.
The following tutorials explain how to perform other common operations in Google Sheets: