Re: Age in days.



> Here is a simple way of calculating a persons age in
> thousands of days.
>
> Age(days) = age(years) / 3 + one tenth of the result.
>
> For a 45 year old: 45 / 3 = 15. Now add one tenth of
> 15 to 15 = 15 +
> 1.5 = 16.5 so the person is approximately 16 500 days
> old.
>
> The person will be less than their calculated age in
> days on their
> birthday. They will reach the calculated days some
> months afterwards.
> The number of months can be calculated by
>
> months = age(years) / 20
>
> So the 45 year old will reach 16 500 days of age
> about 2 months after
> their birthday.
>
> The more mathematically astute will realise that the
> formula for the
> age in days is just
>
> age(days) = 1.1 * x / 3
>
> which, when multiplied by 1000 becomes
>
> age(days) = 366 * age(years)
>
> but it's not so easy to work out mentally as the
> above algorithm.
>

Such algorithms have existed for a long time. Here is a very accurate algorithm to find the number of days from January 1, 1 AD. You could easily employ it to get your number of days old a person is, but with much more accuracy than your algorithm.


Convert the year, month, and day to Julian day. See "Numerical Recipes" by Press, Flannery, Teukolsky, and Vetterling, p10.
Input:
iy = year (AD)
im = month (1 to 12)
id = day (1 to 31)

Algorithm
igreg = 588829;
if iy == 0, error('There is no year 0'), end
if iy < 0, iy = iy+1; end
if im > 2
jy = iy;
jm = im + 1;
else
jy = iy - 1;
jm = im + 13;
end
julday = floor(365.25*jy) + fix(30.6001*jm) + id + 1720995;
if (id + 31*(im+12*iy)) >= igreg
ja = fix(0.01*jy);
julday = julday + 2 - ja + fix(0.25*ja);
end


- MO
.



Relevant Pages

  • Re: Coping with missing year value in date data type field (Rephrased/Repost)
    ... person's birthday, but not his/her actual birthdate, he'll enter 1900-05-04 ... He uses IIf when calculating the age: ... Suppose I am collecting Date of Birth data for a contacts application. ...
    (microsoft.public.access.forms)
  • Re: formatting a calculated number field on a form
    ... > I only used age at death as an example. ... > and heart attack, age 40 and heart attack, surgery and death, etc. ... >>bit different in that a parameter query limits the recordset before it ... I assumed that you were calculating on ...
    (microsoft.public.access.forms)
  • Re: formatting a calculated number field on a form
    ... I only used age at death as an example. ... and heart attack, age 40 and heart attack, surgery and death, etc. ... >bit different in that a parameter query limits the recordset before it ... I assumed that you were calculating on ...
    (microsoft.public.access.forms)
  • Birthday calculations
    ... I am setting up a spreadsheet to calculate people's age and the number of days ... Calculating their age I can do but calculating the ... number of days until their next birthday is proving a little difficult. ... It occurred to me that the formula will be correct for non leap years but will ...
    (microsoft.public.excel.misc)
  • Re: calculating age based on birthdate
    ... This ISN'T an astronomical question. ... If you are calculating the date at which a person becomes eligible for a ... As for the age on the date of birth, that's a convention that is solved by ... user's business rules. ...
    (microsoft.public.excel.worksheet.functions)