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 result with these settings (Start date: B2 (cell B2 (Start Date in column B)), End date: C2 (cell C2 (End Date in column C)), Unit: "D").

Example Table

#
ATask ID
BStart Date
CEnd Date
DNotes
EHoliday
2T0012026/03/012026/03/05Standard task2026/03/03
3T0022026/03/032026/03/10Priority task2026/03/06
4T0032026/03/052026/03/12Standard task2026/03/10
5T0042026/03/082026/03/14Urgent task2026/03/12
6
7
8

How to Use (Formula)

=DATEDIF(B2, C2, "D")

Result

4

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.