View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Sandy Mann Sandy Mann is offline
external usenet poster
 
Posts: 2,345
Default Calculate the difference between ages, show as yy mm

Hilary,

I have managed to set up a spreadsheet that will work out their age based
on
Date of Birth, expressed as custom yy"y" mm"m" e.g. 07y 08m


I don't know how you calculated the age as above but I used DATEDIF()

What I did was:

A2: Pupil's Date of Birth (labelled in A1 as "DOB")
B2: =DATEDIF(A2,TODAY(),"y")
C2: =DATEDIF(A2,TODAY(),"ym")
The two cells B2 & C2 were labelled in B1 & C1 as "Years" & "Months"
respectively

A3: Labelled as "Tested Reading Age"
B3 & C3 were then used to enter the Tested Reading Age in years & months
respectively

B4: =DATEDIF(MIN(A2,A4),MAX(A2,A4),"y")
C4: =ROUND((DATEDIF(MIN(A2,A4),MAX(A2,A4),"ym")+1)/6,0)*6
A4: =DATE(YEAR(TODAY())-B3,MONTH(TODAY())-C3,DAY(A2)-1)

I then hid Row 4 (select any cell in row then Format Row Hide), but this
is not necessary if you don't want to.

A6: =IF(SUM(B4:C4)=0,"Reading age correct",IF(A2A4,"Reading age ahead by "
&YEAR(DATE(B4,C4+1,1))-1900&"Year"&IF(YEAR(DATE(B4,C4+1,1))-1900<1,"s","")&
" and "&IF(C4=0,0,IF(MONTH(DATE(B4,C4,1))=12,0,MONTH(DAT E(B4,C4,1))))&
" Months","Reading age behind by " &YEAR(DATE(B4,C4+1,1))-1900&"Year"&
IF(YEAR(DATE(B4,C4+1,1))-1900<1,"s","")&" and "&
IF(C4=0,0,IF(MONTH(DATE(B4,C4,1))=12,0,MONTH(DATE( B4,C4,1))))&
" Months"))

Now when you enter the tested reading age years in B3 & the odd remaining
months in C3 I got the answer that I think you are looking for.

E-mail me direct if you want an example spreadsheet.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


with @tiscali.co.uk


"Hilary from New Zealand" <Hilary from New
wrote in message
...
Hi, I need to calculate the difference between children's actual age and
their tested reading age.

I have managed to set up a spreadsheet that will work out their age based
on
Date of Birth, expressed as custom yy"y" mm"m" e.g. 07y 08m

I now need to be able to type in their tested reading age (e.g. 08y 03m)
in
the same format, how do I do this?

And then I need to calculate the difference, (rounded to the nearest 6
months).

Please can someone help me! All the teachers I know will be eternally
grateful!