Count Days, Months, and Years with the DATEDIF Function in Excel – Knowligent
Count Days, Months, and Years with the DATEDIF Function in Excel

Count Days, Months, and Years with the DATEDIF Function in Excel

HomeHow to, TechCount Days, Months, and Years with the DATEDIF Function in Excel

The DATEDIF function calculates the period or difference between two dates in days, months, and years. You can use the DATEDIF function to determine the time frame for an upcoming project, or it can be used, along with a person's date of birth, to calculate an individual's age in years, months, and days, for example.

How to Calculate Days, Months, and Years Between Two Dates in Excel

The syntax of a function refers to the layout of the function and includes the function name, parentheses, and arguments. The syntax for the DATEDIF function is:

Besides D, M and Y, there are three other unit options which you can see in the image below:

DATEDIF is a hidden function, so you won't find it in the list of other date functions under the Formula tab in Excel, which means you can't use the Function dialog box to enter it. As a result, you'll have to enter the function and its arguments into a cell manually.