Learn in this article how to easily and quickly calculate the difference between two dates using Microsoft Excel's DATEDIF function.

With this function, you will never have any trouble calculating the duration between two dates in days, weeks, months, or even years!

First of all, launch your Microsoft Excel application.

 

 

Step 1: Enter the dates in the table

Before you can calculate the difference between your dates, you need to add them to your Microsoft Excel spreadsheet!

Write the two dates in two separate cells. They don't need to be written side by side, but it's generally more convenient.

 

Step 2: Calculate the difference between two dates

Now that your dates are entered in the Microsoft Excel spreadsheet, we can proceed with the calculation!

To do this, select an empty cell and, in the field at the top of the application, start typing "=DATEDIF(".

Next, click on the cell with the start date. This adds the cell to your formula.

Later, if you want to calculate the difference between other dates, you only need to change the content of this cell, and the formula's result will update automatically.

Enter ";" in the formula after the start date, then click on the cell with the end date.

Add another ";" to the formula, then type "y" (with quotes).

This specifies to the formula that you want to know the difference in years. If you want to obtain the difference in months or days, simply replace "y" with "m" or "d," respectively.

 

For weeks, it's a little different. There is no direct formula to calculate weeks, so we need to calculate the difference in days and then add "/7" at the end of the formula. This divides the formula's result by 7, giving us the difference in weeks.

Be sure to specify to Microsoft Excel that you want the result as a number, or the application might give you a strange result.

 

There you have it! Now you know how to calculate the difference between two dates in Excel!

 

Check out all our Microsoft Excel courses by clicking the button below to discover all our tips and tricks for using Microsoft 365's spreadsheet tool!

 

All Excel courses

 

? Contact us: 

? By email: support@dileap.com 

? Make an appointment with us 

To stay up to date with our latest news, follow us on LinkedIn