Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculating Child's Age - off by one day

Status
Not open for further replies.

SDLevy

Technical User
Jun 29, 2001
2
US
We do standardized tests on children evaluate for developmental delay. I am trying to set up an excel form to calculate the chronological age - the tests assume that each month has 30 days and 4 weeks. I tried the calculation from MS resource page and am off by one day for some children.

Any suggestions?

Thank you.

This is the formula I tried:
=YEAR(A2)-YEAR(A1)-IF(OR(MONTH(A2)<MONTH(A1),AND(MONTH(A2)=MONTH(A1),
DAY(A2)<DAY(A1))),1,0)&&quot; years, &quot;&MONTH(A2)-MONTH(A1)+IF(AND(MONTH(A2)
<=MONTH(A1),DAY(A2)<DAY(A1)),11,IF(AND(MONTH(A2)<MONTH(A1),DAY(A2)
>=DAY(A1)),12,IF(AND(MONTH(A2)>MONTH(A1),DAY(A2)<DAY(A1)),-1)))&&quot; months,
&quot;&A2-DATE(YEAR(A2),MONTH(A2)-IF(DAY(A2)<DAY(A1),1,0),DAY(A1))&&quot; days&quot;

It also puts a square in front of the days.
 
Why not just use the exact days and weeks per month....?


Regular non-leap year:

4.345238 weeks/month

30.416666 days/month

on leap year the numbers are different:

4.3571428 weeks/month

30.5 days/month

Ya' Gotta Love It!
sleepyangelsBW.jpg
 
ok...I just re-read your post. So maybe its not possible to change the assumptions of the test...? Ya' Gotta Love It!
sleepyangelsBW.jpg
 
Have you looked into using DAYS360 ? It uses a 360 day calendar and 30 days per month.

Sounds like what you need.
 
Thank you for your replies. I am trying the DAYS360, but I need to know the exact number of years, months and days. I cannot use 7.5 for 7 months and ... days. And yes, the standardized tests require we use the 30 days/4 weeks constraint, but some round up and some do not. So for some tests it is critical to know if the child is 14 days or 15 days.

We are in the process of remodeling and my books are packed but as soon as my temporary office is set up I'll keep plugging away at the years, days and months.

thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top