DATEDIF function - Zoho Sheet - Help Guide

DATEDIF

Returns the number of days, months, or years between two given dates.

 

Syntax

 

DATEDIF(start_date; end_date; type)

start_date: Starting date for the period. E.g. "1/1/2020"

end_date: Final or end date for the specified period. E.g. "2/4/2018"

type: Indicates how the result must be. E.g. "Y"  

 

Type

Returns

Y

Number of years in the given period

M

Number of months in the given period

D

Number of days in the given period

MD

Difference between days in start_date and end_date, ignoring the months and years.

YM

Difference between months in start_date and end_date, ignoring the days and years.

YD

Difference between the days in start_date and end_date, ignoring the years alone.

 

Examples

 

Formula

Result

=DATEDIF("1/1/2018";"2/4/2020";"Y")

2

=DATEDIF("4/13/2020";"11/1/2020";"D")

202

=DATEDIF("4/13/2020";"11/1/2020";"MD")

19


Get a hands-on experience of the function in the embedded range below. 



Possible Errors

 

Errors

Meaning

#N/A!

  • The function could not find the value it was asked to look for. Commonly occurs in VLOOKUP and similar functions.

#NAME!

  • The function name is incorrect or invalid.

  • The given defined name (if any) is invalid.

  • There is a typo in the defined name used in the function.

  • Double quotes are missing for text values in the function.

  • Colon missing in a cell range reference.

#VALUE!

  • The given argument's data type is incorrect or invalid.
    For example, the function =DATE(A1:A3) will return a #VALUE error when a text value is present in the range.

#REF!

  • The given cell reference is incorrect or invalid. This error may occur when a cell/range has been deleted, moved, or pasted over.

 

Similar Functions