[Solved] Calculate age in years, months, days

Discuss the spreadsheet application
Locked
ApacheAsg
Posts: 9
Joined: Sun Dec 25, 2022 12:29 am

[Solved] Calculate age in years, months, days

Post by ApacheAsg »

How to calculate age in years, months, days in openoffice. I got the years using the formula

=YEARS(VALUE(I3);NOW();0)

but having difficulties putting it all together with the months, and days preferably in this format: 15Y, 5M, 5D. Thanks all.
Last edited by MrProgrammer on Mon Mar 30, 2026 6:15 pm, edited 1 time in total.
Reason: Tagged ✓ [Solved]
OpenOffice 4.1.7 on Windows
User avatar
Zizi64
Volunteer
Posts: 11511
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: How to calculate age in years, months, days

Post by Zizi64 »

Substract the date of birth from the value NOW(). Then format the result as you want or extract the Years, Months, Days.
Tibor Kovacs, Hungary; LO7.5.8/25.8.5.2 /Win7-10-11 x64Prof.
PortableApps: LO3.3.0-25.8.5.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
ApacheAsg
Posts: 9
Joined: Sun Dec 25, 2022 12:29 am

Re: How to calculate age in years, months, days

Post by ApacheAsg »

I'm more of a visual learner, so I had no luck from the reading instructions, but I did try it and it did not work for me still.

"Substract the date of birth from the value NOW()." and section D, but to no avail.

=YEARS(VALUE(G3);NOW();0)&=MONTHS(VALUE(G3);();0)& (it did not work)

So need additional assistance. See attached. Thanks again.
Attachments
Spreadsheet.ods
(12.37 KiB) Downloaded 141 times
OpenOffice 4.1.7 on Windows
User avatar
Zizi64
Volunteer
Posts: 11511
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: How to calculate age in years, months, days

Post by Zizi64 »

Here are another two approaches:
Age.ods
(23.72 KiB) Downloaded 132 times
I am using the function TODAY() instead of the NOW(). (The NOW() will refresh in every seconds, when you enter new data.)
The result of the substraction will not be exact, because the difference will "hide" the leap years. You can not detect - based on the diference - how many leap years was in the life of the actual person.

I think, the another approach/solution works better.
Tibor Kovacs, Hungary; LO7.5.8/25.8.5.2 /Win7-10-11 x64Prof.
PortableApps: LO3.3.0-25.8.5.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Locked