Clear, practical technology insights BSOD Code Lookup · Windows Error Code Lookup · Wi-Fi Troubleshooting · PC Troubleshooting Checklist

DATEDIF () Function (Calculate the Total Number of Years

Explore DATEDIF () Function (Calculate the Total Number of Years with a clear summary of the key facts, context, and practical details readers should know.

Table of Contents

This article provides a clear overview of DATEDIF () Function (Calculate the Total Number of Years, with the main facts, useful context, and practical details organized for easy reading.

DATEDIF () Function (Calculate the Total Number of Years example screenshot 1

The article describes the syntax and usage of the DATEDIF () function in Excel.

Description

The DATEDIF () function helps you calculate the total number of years, the total number of months, or the total number of days from two given periods.

You can use this function from Excel 2003 and newer versions, the DATEDIF () function is not in the list of Excel functions, so when you enter = DATEDIF, the function is not displayed in the Excel function list.

Syntax

= DATEDIF (start_day, end_day, unit)

Arguments

- start_day: start date to calculate.

- end_day: end date, end_day needs to be bigger than start_day.

- unit: type of result returned by the calculation, to be written in quotation marks.

Below is a list of unit options.

y: the number of years the difference between start_day and end_day.

m: number of months difference between start_day and end_day.

d: number of days difference between start_day and end_day.

md: the number of days difference between start_day and end_day, regardless of the number of years and months.

ym: the number of months difference between start_day and end_day, regardless of the number of years and days.

yd: number of days difference between start_day and end_day, regardless of the number of years.

For Example

Example 1: Use the DATEDIF function to calculate the age of employees.

Apply the function to the last employee: = DATEDIF (D11, NOW (), "y")

- D11: is the start date (year of birth).

- NOW () is a function to get the current date of the computer.

- y to determine the return value is the difference between the current year and the year of birth.

The following results:

DATEDIF () Function (Calculate the Total Number of Years — For Example screenshot 2

Example 2: For start_day is February 1, 2013 and end_day is December 28, 2014, applying all unit options will result in the following:

DATEDIF () Function (Calculate the Total Number of Years — For Example screenshot 3

So you know how to use the DATEDIF () function in Excel. With the support of the DATEDIF () function, the processing of date data calculations will be a lot easier. Good luck!

FAQ

What is the main focus of DATEDIF () Function (Calculate the Total Number of Years?

The article explains the most important facts, context, and practical details related to DATEDIF () Function (Calculate the Total Number of Years.

Who may find this information useful?

It is useful for readers who want a clear overview, practical context, and a better understanding of the subject.

What should readers verify before taking action?

Check current product versions, official requirements, regional availability, and any details that may have changed since the original publication.

Discussion

Reader Comments 0

Sign in with email or Google to join the discussion.