TRUECALC
Functions

DATEDIF

Difference between two dates in specified units

Try it

When to use it

When should I use DATEDIF?

Use DATEDIF to measure the gap between two dates in whole years, months, or days — handy for ages, tenure, and durations.

What does the unit argument in DATEDIF mean?

It sets the unit of the result: Y for full years, M for full months, and D for total days between the two dates.

Use cases

Months of employee tenure

Total days in a project window

Used in

hr · operations

Syntax

DATEDIF(start,end,unit)

Examples

=DATEDIF(DATE(1969,7,16),DATE(1969,7,24),"D") // => 8
=DATEDIF(DATE(2000,1,1),DATE(2001,1,1),"M") // => 12
=DATEDIF(DATE(2001,1,1),DATE(2003,1,1),"Y") // => 2

On this page