Back to all functions

In this lesson we will take a look at how to get the number of years, months, or days between two dates by using the DateDif function.
This function has three arguments: The two cells that we are comparing, and the denomination we want to use.
We’ll type Equals, DateDif, and select the two dates between which we want to find the difference. We first want to find the amount of years between them, so we’ll write a “y” within quotation marks.
The letter can be changed into an “m”, for months… or a “d” for days. For weeks, we can wrap the DateDif function for days in brackets, and divide the number we get by seven.
You can type in “yd” to ignore the years and get only the days between the dates. This can also be done for ignoring the years to get the amount of months using “ym” … And ignoring the months to get the amount of days using “md”.
The DateDif function is a hidden function, meaning that it does not show up as a suggestion in neither the tooltip… nor the insert function button.
In this lessen we have gone through the DATEDIF function.

Popular courses

The Excel Functions Guide

Deepen and develop your Excel Functions skills

Learn how to efficiently manage databases, clear text in cells, and retrieve values from other tables. The course also walks...

Excel Essentials

Get a better understanding of the Excel workflow

Learn to feel more comfortable in Excel. This course will help quickly develop your knowledge in Excel. Excel Essentials is...

Contact us for assistance in finding right course

Excel for your profession

The Excel course for Procurement and Logistic professionals

Excel for professionals working within procurement and logisticians

In cooperation with organisations and professionals within the industry, Learnesy have developed an Excel course that is adapted to those...

Looking for something custom made? Contact us and we will make sure to meet your requirements.