PC Review


Reply
Thread Tools Rate Thread

Calculating Difference Between Two Dates Using Only Year

 
 
rew3791
Guest
Posts: n/a
 
      16th Nov 2009
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

--
Rachel
 
Reply With Quote
 
 
 
 
T. Valko
Guest
Posts: n/a
 
      16th Nov 2009
Excel doesn't support dates before Jan 1 1900.

If you try to enter a date before Jan 1 1900 Excel evaluates it as a TEXT
string, not a date.

See if this helps:

http://spreadsheetpage.com/index.php...re_1900_dates/

--
Biff
Microsoft Excel MVP


"rew3791" <(E-Mail Removed)> wrote in message
news:AF1AF0C4-0F4E-467F-A6F2-(E-Mail Removed)...
> 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
>
> --
> Rachel



 
Reply With Quote
 
Jacob Skaria
Guest
Posts: n/a
 
      16th Nov 2009
If it is just the year you have in ColC and Col D try

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

If this post helps click Yes
---------------
Jacob Skaria


"rew3791" wrote:

> 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
>
> --
> Rachel

 
Reply With Quote
 
David Biddulph
Guest
Posts: n/a
 
      16th Nov 2009
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
--
David Biddulph


"rew3791" <(E-Mail Removed)> wrote in message
news:AF1AF0C4-0F4E-467F-A6F2-(E-Mail Removed)...
> 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
>
> --
> Rachel



 
Reply With Quote
 
T. Valko
Guest
Posts: n/a
 
      16th Nov 2009
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.

--
Biff
Microsoft Excel MVP


"David Biddulph" <groups [at] biddulph.org.uk> wrote in message
news:4b018f1c$(E-Mail Removed)...
> 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
> --
> David Biddulph
>
>
> "rew3791" <(E-Mail Removed)> wrote in message
> news:AF1AF0C4-0F4E-467F-A6F2-(E-Mail Removed)...
>> 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
>>
>> --
>> Rachel

>
>



 
Reply With Quote
 
Bill Sharpe
Guest
Posts: n/a
 
      17th Nov 2009
rew3791 wrote:
> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Retrieving Year and calculating difference RP Microsoft C# .NET 4 20th Aug 2007 04:49 PM
Calculating the difference between to dates =?Utf-8?B?VGhlUm9vaw==?= Microsoft Excel Programming 2 19th Jul 2006 12:08 PM
Calculating the difference in dates sonar Microsoft Excel Worksheet Functions 1 23rd Oct 2004 06:09 PM
Calculating the difference in dates sonar Microsoft Excel Worksheet Functions 2 23rd Oct 2004 04:02 PM
Calculating the difference between dates Jonathan Microsoft Access Forms 1 6th May 2004 01:40 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:49 AM.