Calculating Age in Years and Months

Hi,

I am a headteacher trying to organize pupils for next year using Numbers. I have two issues that I am struggling with!


The spreadsheet I am trying to create is a very basic one - Name; Sex; DOB; AGE in Years & Month; School Year.


Firstly I need to try and calculate the child's age in years and months. I have been through the help section as much as I could and reached =DATEDIF(A1, TODAY(), "Y") but unfortunately I just can't get the months to appear. I need the months otherwise all pupils in the class will appear the same and I cannot differentiate to spilt classes by age easily.


Secondly I would like the School year to fill itself in dependant on the age range. So for example - a DOB between 01 Sept 2004 - 31 Aug 2005 would place a child in Year 2 and the cell would populate itself YR2.


Hopefully somebody could help me with this.


Thanks in advance

2Ghz MacBook Pro, Dual Core PowerMac, Mac OS X (10.5.6)

Posted on May 24, 2011 3:02 AM

Reply
15 replies

May 24, 2011 7:18 AM in response to Gwyn Plem

User uploaded file

In D2, the formula is :

=IF(ISBLANK($C),"",(DATEDIF(C2,TODAY(),"Y")&"y "&DATEDIF(C2,TODAY(),"YM")&"m "&DATEDIF(C2,TODAY(),"YM")&"d"))


In E2, it is :

=IFERROR(VLOOKUP(C2,look_up :: A:B,2),"")


Apply Fill Down




Yvan KOENIG (VALLAURIS, France) mardi 24 mai 2011 16:18:44


Please :

Search for questions similar to your own before submitting them to the community


To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

May 26, 2011 11:15 AM in response to Badunit

There are two basic parts to this:

1) Determine the students' age:

This involves establishing a "common" unit for age that avoids non-standard length years and can be compared to a table in item (2). I select to use "days" as the units for a students' age


2) Establish a rule for when a student changes grades

This involves setting up a table that provides a list of ages (on Sept 1 of every year) using the same units as in step (1)


In the image of a sheet, below, the table on the left, "Student Info", allows the user to input:

A) the students name

B) the Date of Birth (DOB) for each student


The table then computes the students age in days (along with some other info). The last column in the this table performs a vlookup of the age into the table on the right, "Year Lookup" to find the year the student should be in.


User uploaded file


The main formulas are:


"Year Lookup"

B4 =DATEDIF(D4,$D$3,"D") [Fill down]

D1=IF(B1>0, B1, YEAR(C1))

C1=NOW()

D3=DATE($D$1-A3, 9, 1) [Fill Down]


"Student Info" [Fill all down]

C2=IF(ISBLANK(B2),"",DATEDIF(B2,NOW(), "D"))

D2=IF(ISBLANK(B2),"",INT(DATEDIF(B2,NOW(), "M")/12)&" Yrs "& MOD(DATEDIF(B2,NOW(), "M"), 12)&" Mos")

E2=IF(ISBLANK(B2),"",DATEDIF( B2, Year Lookup :: $D$3, "D")-1)

F2=IF(ISBLANK(B2),"","Year "&VLOOKUP(E2,Year Lookup :: $B$3:$C$16, 2))



If you don't want to type all this in here is a link to my example:

http://public.iwork.com/document/?a=p12259087&d=Student_Year.numbers


Updated hyperlink

May 26, 2011 2:26 PM in response to Wayne Contello

Gwyn,


Here's a single table solution. Not necessarily better than using a lookup table, but I submit this for variety.


User uploaded file


This approach calculates a specific September 1 date based upon current date, so next year it will calculate Sep 1, 2012 and the school year calculations will update. This rollover will occur on Jan 1.


Here are the formulas:


D1: =TODAY()


E1: =DATE(YEAR(TODAY()),9,1)


E2: ="Age on " & E1


Column D body rows: =DATEDIF($C, TODAY(),"Y") & " Y " & DATEDIF($C, TODAY(),"YM") & " M"


Column E body rows: =DATEDIF($C, $E$1,"Y") & " Y " & DATEDIF($C, $E$1,"YM") & " M"


Column F body rows: =IF(DATEDIF(C,$E$1,"Y")-4>0, "YR"&DATEDIF(C,$E$1,"Y")-4, "")


Regards,


Jerry

May 24, 2011 7:18 AM in response to Gwyn Plem

The following expression will give you the years and months of age to the current date if the birth date is in Column A. You can make adjustments from there.


=INT(DATEDIF(A,TODAY(),"M")/12) & " Years and "&MOD(DATEDIF(A,TODAY(),"M"),12)&" Months"


As for the grade year calculation, when do you begin talking in terms of the school year that begins in September? Are you today talking about the year just about to end, or the next one?


Regards,


Jerry

May 24, 2011 7:37 AM in response to Jerrold Green1

Because Badunit posted before and edited after.

When I posted my laughing message, the badunit one was empty and stamped 10:18. 😝


Yvan KOENIG (VALLAURIS, France) mardi 24 mai 2011 16:37:17


Please :

Search for questions similar to your own before submitting them to the community


To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

May 25, 2011 7:07 AM in response to KOENIG Yvan

Thank you very much for all replies - I appreciate it very much. I am having a little difficulty with the school year here. I have am unsure how to define the dates in the look_up table. For the next year the pupils born between 1st September 2000 and 31 August 2001 are in year 6; 1/9/2001 - 31/8/2002 in year 5 and so on. I have placed 1st september in cell A1 - A8 and the corresponding Year in B1 - B8. Unfortunatley it does not populate the cell in the main table with the corresponding year. Could you just clarify how I define the look-up table. Thanks.

May 25, 2011 7:15 AM in response to Gwyn Plem

Gwyn,


You may have missed my question above. I'll repeat.


As for the grade year calculation, when do you begin talking in terms of the school year that begins in September? Are you, today, talking about the year just about to end, or the next one? My guess is that if a student is now in Yr 2 and in the school year beginning about September 1 will be in Yr 3, we will refer to him/her as being in Yr 2 until September 1, at which time we will say he is in Yr 3. Is this correct?


Regards,


Jerry

May 25, 2011 4:02 PM in response to Jerrold Green1

Jerry, Sorry yes I did miss your question - sorry.


Yes you are correct - I am trying to sort out next year's class allocation which will be dependant on age mostly. Also - yes you are correct that they progress Year 2, Year 3. September 1st is the cut off date for any child. A child born on August 31st will be in a different school year than a child born 1st September - one being the oldest in her year, the other the youngest. Hope I have given enough information! Thanks very much

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Calculating Age in Years and Months

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.