# DATEDIF function

Excel DATEDIF Function is a useful tool for calculating the difference between two dates in a simple and straightforward way. It allows you to find the number of years, months, or days between two dates, making it handy for various tasks like tracking project timelines, calculating age, or determining the duration of an event.

## Syntax

The syntax for the DATEDIF function is:

DATEDIF(start_date, end_date, “unit”)

## Arguments

Here are the arguments you can use with the DATEDIF function:

## How to Use

Using the DATEDIF function is quite simple. Let’s see some examples to understand it better:

Example 1: Calculate the number of years between two dates

This formula calculates the number of complete years between the dates in cells A1 and B1.

Example 2: Calculate the number of months between two dates

This formula computes the number of full months between the dates in cells A2 and B2.

Example 3: Calculate the number of days between two dates

Here, the formula determines the number of complete days between the dates in cells A3 and B3.