Forum Discussion
Caroline1
Sep 20, 2025Copper Contributor
calculating years between 2 dates help
Hi I am having an issue calculating number of years between 2 dates on excel. When i used the dateif function, i get a #name? error and when i yearfrac i get #value! or else a number like 1/3/00 ple...
PeterBartholomew1
Sep 23, 2025Silver Contributor
DATEDIF would return a #NAME? error if you actually typed the function as "dateif".
= DATEDIF(startDate, endDate, "Y")
should work. The problem with
= YEARFRAC(startDate, endDate)
is that you are formatting the count of years as a date. If you are in the US, 1/3/00 is the 3rd January and General format will show it as 3. Anywhere else in the world the date is the 1st March which has a date value of 61.