Forum Discussion
how to calculate age in excel
One gets no help with this deprecated function but
= DATEDIF(dob, today, {"y","ym"})
would still give ages in years and months. The alternative
= INT(YEARFRAC(+dob, today))
works fine, but it is one of the functions in which the range of birthdates needs to be converted to an array using "+" or "--" for some obscure reason.
The alternative
= INT(YEARFRAC(+dob, today))
works fine, but it is one of the functions in which the range of birthdates needs to be converted to an array using "+" or "--" for some obscure reason.
Not in my experience.
It didn't need the "+" or "--" when I tested it before replying. See below. [Cell B1 contains =TODAY() ]
- PeterBartholomew1Feb 14, 2024Silver Contributor
As it stands, your formula works fine. It is
= INT(YEARFRAC(A1:A10, B1))
that becomes a problem. I have been caught out a number of times by this generation of time functions that appear to be perfectly formed but fail given multi-cell range references.
- mathetesFeb 14, 2024Silver ContributorGot it. Hence your reference to an array!