Guide on using the DATEDIF function in Google Sheets

The DATEDIF function in Google Sheets is similar to the DATEDIF function in Excel, as it helps calculate the time difference between two dates. DATEDIF in Google Sheets offers various time calculation formulas, depending on the desired interval between the two dates. Here is a guide on using the DATEDIF function in Google Sheets.

The DATEDIF function in Google Sheets has the formula =DATEDIF(start_date, end_date, unit). Here’s what each component represents:

  • Start_date: It is the date used as the starting point.
  • End_date: It is a date used as the ending point.
  • Unit: It specifies the desired interval to be returned.

The DATEDIF function in Google Sheets returns the calculated result based on the user’s request, using different unit symbols.

  • “D” – (Abbreviation for Date) returns the number of days between two dates.
  • “M” – (Months) returns the complete number of months between two dates.
  • “Y” – (Year) returns the complete number of years.
  • “MD” – (Days ignoring Months): Returns the remaining days after subtracting the complete months.
  • “YD” – (Days ignoring Years): Returns the remaining days after subtracting the complete years.
  • “YM” – (Months ignoring years): Returns the complete number of months after subtracting the complete years.

All units need to be enclosed in double quotation marks.

Guide on using the DATEDIF function in Google Sheets

We have a time table as shown in the image below to calculate the time difference between two dates.

Counting days between two dates

Enter the formula =DATEDIF(B2, C2, “D”) and press Enter.

Immediately, we obtain the result of the number of days between the two dates. Drag down the formula to display the results for the remaining cells.

Counting days ignoring months, the number of days that are not within complete months

Enter the formula =DATEDIF(B16, C16, “MD”) and press Enter.

You will then get the number of days that are not within complete months within the given time range, as shown in the image.

Counting days ignoring years, returning the number of days that are not within complete years

Enter the formula =DATEDIF(B16, C16, “YD”) and press Enter.

You will also get the result as shown in the image, which represents the number of days that are not within complete years.

Leave a Comment

Your email address will not be published. Required fields are marked *

Shopping Basket
Scroll to Top