Is there a resource on the web to calculate someone's age?

I’m thinking about a research project that will involve comparing the ages of a variety of people. For this purpose, I would need to be as accurate as possible in determining their ages, taking into account their exact birth and death dates. In some cases, just subtracting their years of birth from years of death don’t give the right number (e.g. - if someone was born in November, 1960, and died in January 2000, their age at death was 39 and two months, not 40).

Is there anything on the web that would allow me to plug in the exact date of birth and death, and get the resulting age at death, preferably with the fractional difference expressed as a decimal?

This isn’t quite what you’re looking for.

It’s a bit more then what you want but yes. The Personal Ancestral File will do that. It’s a family tree program that will do year, months, and days. It’s under tools and calculate date. I’d guess most family tree programs do this, but PAF is free and small.

Yeah, it’s a very specific problem within the field of date difference calculation, which most of the online calculators don’t have as a default option as far as I can see.

Someone with a bit of programming knowhow and a web server running asp/php could probably provide you with one easily enough. It could probably also be done in javascript by anybody with a webpage.

I might take a crack at it for you if nobody else volunteers. :smiley:

Do you have access to excel? If you subtract dates in excel the result is difference in days. If you then divide by 365 you get pretty much what you want.

There’s even a function, YEARFRAC(), that gives the difference of two dates in decimal years.

thanks for the comments, everyone. I’ve got Excel but know little about it. I’ll see if that works for my purposes.

Excel doesn’t deal well with calculating dates in this manner exceptionally well, in my experience. You have to do nest a lot of if statements and watch out for a lot of fencepost errors. It’s doable, but it’s not intuitive.

For example, here’s the formula I use to determine someone’s exact age as of today:

=IF(MONTH(D5)>MONTH(TODAY()),(YEAR(TODAY())-YEAR(D5)-1),IF(MONTH(D5)<MONTH(TODAY()),(YEAR(TODAY())-YEAR(D5)),IF(DAY(D5)>(DAY(TODAY())),(YEAR(TODAY())-YEAR(D5)-1),(YEAR(TODAY())-YEAR(D5)))))

It is pretty easy. I put into cell A1 3/5/1971 and into A2 3/4/1972 and into A4 =A1-A2 and the answer is 367. Or using vd’s method into A5 =YEARFRAC(A1,A2) gives 1.0027778.

As long as that’s the level of accuracy needed, that’s a fine solution. I somehow got it into my head that the OP needed “years, months, days” accuracy.

If you want years, months and days, the following will work, and will break it down into individual cells, so you can do what you like with it.

Put date of birth in A1, date of death in B1. Make sure both have date formatting applied.

In C1, put: =DATEDIF(A1,B1,“y”)

In D1, put: =DATEDIF(A1,B1,“ym”)

In E1, put: =DATEDIF(A1,B1,“md”)
If that works for you, copy the formulas down as far as needed, and add new dates in columns A and B as desired.

If you want it expressed as a decimal fraction, and you don’t mind a being off a fractional day or so (due to leap days simply being spread across four years using this method), then simply put the following formula in C1, and format to as many decimal places as you’d like: =DATEDIF(A1,B1,“d”)/365.25

By the way, if you’re going to use the YEARFRAC function (which I usually avoid for various reasons), be sure you supply a basis parameter. The default is count 30 day months and 360 day years.

Those are great, DMC. Why have I never seen those formulas documented in Excel? It’s not even in the list of available functions.

If you happen to have an iPhone, I’ve seen several date calculation apps, such as this one.

I actually suck at Excel, but my background is in SQL Server, and since we have all sorts of nifty date functions I always try and find equivalents whenever I have to do something in .Net or Excel. Now I just wish that I could find the SQL Server equivalent of a Excel’s Date function. That’s still one of the coolest functions around, even though it looks all innocent and useless at first glance, and even though you can accomplish everything it does in other ways. One of the things I learned in the SQL world that I carry over is “the zero date” based math. Since the underlying engines all have a date that they consider numerically equivalent to zero, you can use it.

Want to find out the last day of the month prior to a given date, even if it was in a prior year? This uses DateDif, as well as the much misunderstood “Date” function, and zero-date based math.

=DATE(YEAR(0),MONTH(0) + DATEDIF(0,A1,“m”),DAY(0))

Last day of the month of a given date? Just add one month to it, as shown here.

=DATE(YEAR(0),MONTH(0) + DATEDIF(0,A1,“m”)+1,DAY(0))

How about first day of the next month from a given date, even if it crosses a year? Simply change that “Day(0)” to “Day(1)” as below.

=DATE(YEAR(0),MONTH(0) + DATEDIF(0,A1,“m”) +1,DAY(1))

Similarly, last day of previous year and various other commonly needed dates can be calculated in this way.

Crap, right after posting that, I remembered one of the reasons I like the “Date” function so much, and that it eliminates the need for jumping through some of those hoops. You can actually avoid the zero-date based math for most thing. Last day of previous month is simply (assuming date to calculate from is in A1):

=DATE(YEAR(A1),MONTH(A1),DAY(0))

Last day of current month?

=DATE(YEAR(A1),MONTH(A1) +1,DAY(0))

First day of next month?

=DATE(YEAR(A1),MONTH(A1) +1,DAY(1))

… and so on.