<< Go back to all functions

DATEDIF

The DATEDIF function in Google Sheets is a powerful tool to calculate the number of days, months, or years between two dates. Whether you're tracking project timelines, calculating employee tenure, or monitoring financial goals, the DATEDIF function simplifies the task. Dive into our comprehensive guide to master its application.

Function Syntax and Parameters

Syntax: DATEDIF(start_date, end_date, unit)

Parameters:

  • start_date: The starting date for the calculation.
  • end_date: The ending date for the calculation.
  • unit: The unit of measurement for the calculation (e.g., "d" for days, "m" for months, "y" for years).

Step-by-Step Tutorial

  1. Calculating the number of days:

    • Example: =DATEDIF("2022-01-01", "2022-12-31", "d")
    • Result: 364
  2. Calculating the number of months:

    • Example: =DATEDIF("2022-01-01", "2022-12-31", "m")
    • Result: 11
  3. Calculating the number of years:

    • Example: =DATEDIF("2022-01-01", "2022-12-31", "y")
    • Result: 1

Use Cases and Scenarios

  1. Project Management: Determine the duration of a project.
  2. HR Analytics: Calculate the tenure of employees.
  3. Financial Planning: Track the number of years until retirement.

Related Functions

  • TODAY: Get the current date.

Related Articles