Forum Discussion
Tknerd
Dec 04, 2020Copper Contributor
Converting days into Years and Months not working for some data
Hi I have the formula below and its returning incorrect data =INT(O83/365) & " years and " &MOD(O83,12)& " months" O83 = 240 days I am getting the result of 0 Years and 0 months. Th...
HansVogelaar
Dec 04, 2020MVP
Such formulas will only return an approximate result, since a year is not always 365 days, and since a month does not always have the same number of days. If you're willing to accept approximate results:
Years: =INT(O83/365.25)
Months: =INT(MOD(O83,365.25)*12/365.25) or =INT(MOD(O83*12/365.25,12))
If you have a start date and end date in, say, M83 and N83, more accurate formulas are
Years: =DATEDIF(M83,N83,"y")
Months: =DATEDIF(M83,N83,"ym")