[Solved] Error using formulas to calculate the age

Discuss the spreadsheet application
Post Reply
x-x51h
Posts: 10
Joined: Wed Dec 13, 2017 10:53 pm

[Solved] Error using formulas to calculate the age

Post by x-x51h »

Hi. I'm trying different formulas to calculate the age of a person but I always get an error. Or 501 or 508.
Thanks.
Last edited by x-x51h on Sun Jan 14, 2018 1:40 pm, edited 1 time in total.
Apache OpenOffice 4.1.4
Windows 7 x86
User avatar
robleyd
Moderator
Posts: 5087
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Error using formulas to calculate the age of a person

Post by robleyd »

It would help if you tell us exactly what formulas you are trying and what error you get with each; or better upload a sample spreadsheet showing the problems you are encountering.

[Forum] How to attach a document here Note maximum file size is 128K. If your file is larger, use a file sharing site such as Mediafire. The link also contains information on how to anonymise your document if it contains confidential information.
Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.2.2; SlackBuild for 24.2.2 by Eric Hameleers
x-x51h
Posts: 10
Joined: Wed Dec 13, 2017 10:53 pm

Re: Error using formulas to calculate the age of a person

Post by x-x51h »

=DATEDIF(A2,NOW(),"y") - Err:501

=DATEDIF(A2,TODAY(),"Y") & " Years, " & DATEDIF(A2,TODAY(),"YM") & " Months, " & DATEDIF(A2,TODAY(),"MD") & " Days" - Err:501

With other formulas that I don't remember now, the error was 508.
Apache OpenOffice 4.1.4
Windows 7 x86
User avatar
robleyd
Moderator
Posts: 5087
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Error using formulas to calculate the age of a person

Post by robleyd »

Calc does not have a DATEDIFF function - that is a Base function.

See Calculate a persons age from birthdate for some ideas.
Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.2.2; SlackBuild for 24.2.2 by Eric Hameleers
x-x51h
Posts: 10
Joined: Wed Dec 13, 2017 10:53 pm

Re: Error using formulas to calculate the age of a person

Post by x-x51h »

=YEARS(DATE(A1;1;1); TODAY(); 0)
This formula works with no errors.
Thanks a lot!
Apache OpenOffice 4.1.4
Windows 7 x86
Post Reply