Excel Function

DATEDIF

Returns difference between dates in selected unit.

DATEDIF(start_date, end_date, unit)

Arguments

start_date

Required

Enter a date/reference-related value.

end_date

Required

Enter a date/reference-related value.

unit

Required

Set DATEDIF unit: "Y" years, "M" months, "D" days, plus "MD", "YM", "YD".

Practice Preview

Use DATEDIF to return the number of complete years from cell B2 (入社日 in column B) to cell C2 (基準日 in column C) using unit "Y".

Example Table

#
AEmployee ID
B入社日
C基準日
2E0012019/04/012026/03/31
3E0022023/10/152026/03/31
4E0032025/12/012026/03/31
5
6
7
8

How to Use (Formula)

=DATEDIF(B2, C2, "Y")

Result

6

Practice This Function

DATEDIF FAQ

How do I use DATEDIF in Excel?

Use DATEDIF when you want to calculate the difference between dates. Enter Start date, End date, Unit in that order, then add optional arguments when needed.

Where can I practice DATEDIF?

Use the "Start Function Practice" button to jump straight into DATEDIF drills.

What arguments does DATEDIF use?

The main arguments are Start date, End date, Unit. Enter them in order.