Calculating Difference Between Two Dates Using Only Year

R

rew3791

I'm using Excel 2007. I'm trying to calculate the Age at Death when given
the birth and death years.

I tried using the =DATEDIF function, but 2007 doesn't seem to support it.
Then I tried =YEAR(C3)-YEAR(D3), and you can see the results below. I think
it's because I entered the years as text, but when I tried to format the
columns for the date, I couldn't find a format that would let me list ONLY
the year. I had to have a month and/or day too. I'm not an excel expert, so
I'm probably missing something fundamental. Any help?

Surname Given Name Birth Yr Death Yr Age at Death
Adam Catharine 1859 5
Adam Joseph 1806 1876 -1
Adam Josephine 1856 1942
 
J

Jacob Skaria

If it is just the year you have in ColC and Col D try

=IF(COUNT(C1:D1)=2,D1-C1,"")

If this post helps click Yes
 
D

David Biddulph

DATEDIF is supported in 2007, just as it was in 2003 and other versions.
The only respect in which it isn't supported is that (inexplicably) it isn't
included in Excel help (and as far as I am aware it is the only function to
be omitted therefrom).

You'll find details at http://www.cpearson.com/excel/datedif.aspx

But, as others have pointed out, you don't have dates (which wouldn't be
valid before 1900) but you merely have a year; so in that case you don't
want
=YEAR(C3)-YEAR(D3)
but instead you want
=C3-D3
 
T

T. Valko

Rick Rothstein reported a bug in DATEDIF when using Excel 2007 with SP2.

=DATEDIF(DATE(2009,6,27),DATE(2012,1,5),"md")

In Excel 2007 with SP2 that formula returns 122 when the correct result
should be 9. Excel 2007 with SP1 returns the correct result.
 
B

Bill Sharpe

rew3791 said:
I'm using Excel 2007. I'm trying to calculate the Age at Death when given
the birth and death years.

I tried using the =DATEDIF function, but 2007 doesn't seem to support it.
Then I tried =YEAR(C3)-YEAR(D3), and you can see the results below. I think
it's because I entered the years as text, but when I tried to format the
columns for the date, I couldn't find a format that would let me list ONLY
the year. I had to have a month and/or day too. I'm not an excel expert, so
I'm probably missing something fundamental. Any help?

Surname Given Name Birth Yr Death Yr Age at Death
Adam Catharine 1859 5
Adam Joseph 1806 1876 -1
Adam Josephine 1856 1942
If you're just concerned about the year, format the columns with years
in them as numbers, not dates. This completely avoids the pre-1900 problem.

Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top