How old are you?

  • Thread starter Thread starter teeb
  • Start date Start date
T

teeb

I'm trying to work out the age of someone, based on the current date an
their date of birth. I've used the YEAR [Year(A1)-Year(B1)] function bu
it rounds up?

Can anyone help?

Thank
 
Try DATEDIF:


=DATEDIF(A1,NOW(),"y") & " years, " & DATEDIF(A1,NOW(),"ym") & " months, " &
DATEDIF(A1,NOW(),"md") & " days"


if the date of birth is in A1
 
Try this, it uses functions that are documented.

=YEAR(TODAY()-A1)-1900
 
Try this one[with Birth Date on A1]

=(NOW()-A1+1)/365.25

(365.25 because of leap-years)
 
Hi Roberto,
what's that, an attempt at precision, without accuracy?
Look at the replies involving DATEDIF. Please don't post incorrect
answers, people are very particular about birthdates.
 
The original formula was incorrect so this is also incorrect,
see the replies involving DATEDIF for a correct answers.
You might want to test your answers.
 
Hi,
I´d like to ask: what's incorrect in my answer?
I use this formula very often to calculate employees payments that are
directly related to their hiring date.
Of course I know DATEDIF function, but in this case I need age in decimal
format.
And of course I do not think I'm giving 'incorrect' posts: We all try to
cooperate, I supose.
Kind Regards.


David McRitchie said:
Hi Roberto,
what's that, an attempt at precision, without accuracy?
Look at the replies involving DATEDIF. Please don't post incorrect
answers, people are very particular about birthdates.

Hernandez said:
Try this one[with Birth Date on A1]
=(NOW()-A1+1)/365.25
 
There are several things wrong with your answer.
The poster did not ask for decimal fractions of age, you only have an approximation.
The function NOW() includes both a date and time component.
There are not 365.25 days in a year, there are leap years, ages aren't based on averages.
You did not test your answer, people are very particular about birthdays.


1990-04-01 2006-03-31 16.000 <-- incorrect, s/b 15.000
1990-04-01 2006-04-01 16.003 <-- 16th birthday, s/b 16.000
1990-04-01 2006-04-02 16.005 <-- incorrect
1991-04-01 2006-03-31 15.001 <-- incorrect
1991-04-01 2006-04-01 15.003 <-- 15th birthday, s/b 15.000
1991-04-01 2006-04-02 15.006 <-- incorrect
1992-04-01 2006-03-31 13.999 <-- incorrect
1992-04-01 2006-04-01 14.001 <-- 14th birthday , s/b 14.000
1992-04-01 2006-04-02 14.004 <-- incorrect
1993-03-31 2006-03-31 13.002 <-- incorrect
1993-04-01 2006-04-01 13.002 <-- 13th birthday, s/b 13.000
1993-04-02 2006-04-02 13.002 <-- incorrect
1990-04-01 2006-10-01 16.504 <-- incorrect



Hernandez said:
Hi,
I´d like to ask: what's incorrect in my answer?
I use this formula very often to calculate employees payments that are
directly related to their hiring date.
Of course I know DATEDIF function, but in this case I need age in decimal
format.
And of course I do not think I'm giving 'incorrect' posts: We all try to
cooperate, I supose.
Kind Regards.


David McRitchie said:
Hi Roberto,
what's that, an attempt at precision, without accuracy?
Look at the replies involving DATEDIF. Please don't post incorrect
answers, people are very particular about birthdates.

Hernandez said:
Try this one[with Birth Date on A1]
=(NOW()-A1+1)/365.25
 
Ok.
No doubt.
From now on, I'll only take, and won´t try to give in this forum.
I suposed diversity in suggestions will give a wider panorama to the poster.
But as i could see, I am in diapers [it´s a modism, here in MX]

Kind regards, Most Very Perfect David

David McRitchie said:
There are several things wrong with your answer.
The poster did not ask for decimal fractions of age, you only have an
approximation.
The function NOW() includes both a date and time component.
There are not 365.25 days in a year, there are leap years, ages aren't
based on averages.
You did not test your answer, people are very particular about birthdays.


1990-04-01 2006-03-31 16.000 <-- incorrect, s/b 15.000
1990-04-01 2006-04-01 16.003 <-- 16th birthday, s/b 16.000
1990-04-01 2006-04-02 16.005 <-- incorrect
1991-04-01 2006-03-31 15.001 <-- incorrect
1991-04-01 2006-04-01 15.003 <-- 15th birthday, s/b 15.000
1991-04-01 2006-04-02 15.006 <-- incorrect
1992-04-01 2006-03-31 13.999 <-- incorrect
1992-04-01 2006-04-01 14.001 <-- 14th birthday , s/b 14.000
1992-04-01 2006-04-02 14.004 <-- incorrect
1993-03-31 2006-03-31 13.002 <-- incorrect
1993-04-01 2006-04-01 13.002 <-- 13th birthday, s/b 13.000
1993-04-02 2006-04-02 13.002 <-- incorrect
1990-04-01 2006-10-01 16.504 <-- incorrect



Hernandez said:
Hi,
I´d like to ask: what's incorrect in my answer?
I use this formula very often to calculate employees payments that are
directly related to their hiring date.
Of course I know DATEDIF function, but in this case I need age in
decimal
format.
And of course I do not think I'm giving 'incorrect' posts: We all try to
cooperate, I supose.
Kind Regards.


David McRitchie said:
Hi Roberto,
what's that, an attempt at precision, without accuracy?
Look at the replies involving DATEDIF. Please don't post incorrect
answers, people are very particular about birthdates.

Try this one[with Birth Date on A1]
=(NOW()-A1+1)/365.25
 
Hi Roberto,

So you think that you should not be told that an answer is incorrect,
and that the person who is asking the question should not be warned,
and the people who read archived postings should not be warned.

Much of learning is from improving on previous solutions and
mistakes. While you can learn a lot by making lots of mistakes and
correcting them, you will not always recognize your own mistakes, and
it is also helpful and faster to learn from interaction
with others so that you don't make the same mistakes in the future.

To me I'd be more concerned with applying something incorrectly
over several years at work than by learning that is incorrect in a
newsgroup, or that even if correct would be the wrong answer for
the poster looking for an age (no fractions).
 
I don't know about the rest of you but this post sounds like it is an
assignment from a beginning programming class. You trying to get others
to do your school work?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top