YEARFRAC function - Zoho Sheet - Help Guide

YEARFRAC

Returns the number of years, including fractional years, between two given dates.

 

Syntax

 

YEARFRAC(start_date; end_date; [basis])

start_date: The date from which to calculate the number of years. E.g. "2/5/2020"

end_date: The date up to which to calculate the number of years. E.g. "7/8/2020"

basis: Indicates the day count method to use. Defaults to 0 if omitted.

0 - US method (NASD), 12 months of 30 days each
1 - Exact number of days in months, exact number of days in year
2 - Exact number of days in month, year has 360 days
3 - Exact number of days in month, year has 365 days
4 - European method, 12 months of 30 days each

 

Examples

 

Formula

Result

=YEARFRAC("2/5/2000";"7/8/2020";0)

20.425

=YEARFRAC(D2;E2;1)

0.163934426

=YEARFRAC("1/1/2018";"1/1/2019";2)

1.013888889


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