We can use the DATEDIF() function to calculate the difference between two dates in Excel.
This function uses the following syntax:
=DATEDIF(Start_Date, End_Date, Metric)
where:
- Start_Date: The start date
- End_Date: The end date
- Metric: The metric to calculate. Options include:
- “d”: Days
- “m”: Months
- “y”: Years
It’s important to note that this function won’t automatically appear in Excel until you completely type =DATEDIF( into one of the cells.
The following examples show how to use this function to calculate the difference between two dates in Excel.
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 following image shows how to calculate the difference (in years and months) between two dates:
You can find more Excel tutorials on this page.