PC Review


Reply
Thread Tools Rate Thread

converting text into years

 
 
Craig
Guest
Posts: n/a
 
      18th Feb 2009
Hi,

I have one column of text imported into excel that looks like column A
data...I want to use a function that would give me whats in Column B, that
is, the year of the last two characters in col A...I tried the year function
and it worked for 1996-2000, but not for years 2001-2008...it gave me 2009 as
a result.

Any help appreciated very much

Craig
col A I want Col B to look like this:
01-00 2000
01-00 2000
01-00 2000
01-03 2003
01-01 2001
01-02 2002
01-07 2007
01-04 2004
01-08 2008
01-99 1999
01-98 1998
01-97 1997
01-96 1996


 
Reply With Quote
 
 
 
 
Luke M
Guest
Posts: n/a
 
      18th Feb 2009
=VALUE(IF(VALUE(RIGHT(A1,2))>9,"19","20")&RIGHT(A1,2))

I'm assuming you have not "future" dates, so the latest year this function
will return is 2009. If 2009 is not an option, change the comparison to ">8"
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Craig" wrote:

> Hi,
>
> I have one column of text imported into excel that looks like column A
> data...I want to use a function that would give me whats in Column B, that
> is, the year of the last two characters in col A...I tried the year function
> and it worked for 1996-2000, but not for years 2001-2008...it gave me 2009 as
> a result.
>
> Any help appreciated very much
>
> Craig
> col A I want Col B to look like this:
> 01-00 2000
> 01-00 2000
> 01-00 2000
> 01-03 2003
> 01-01 2001
> 01-02 2002
> 01-07 2007
> 01-04 2004
> 01-08 2008
> 01-99 1999
> 01-98 1998
> 01-97 1997
> 01-96 1996
>
>

 
Reply With Quote
 
Shane Devenshire
Guest
Posts: n/a
 
      18th Feb 2009
Hi,

Try

=YEAR(LEFT(A5,5))

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"Craig" wrote:

> Hi,
>
> I have one column of text imported into excel that looks like column A
> data...I want to use a function that would give me whats in Column B, that
> is, the year of the last two characters in col A...I tried the year function
> and it worked for 1996-2000, but not for years 2001-2008...it gave me 2009 as
> a result.
>
> Any help appreciated very much
>
> Craig
> col A I want Col B to look like this:
> 01-00 2000
> 01-00 2000
> 01-00 2000
> 01-03 2003
> 01-01 2001
> 01-02 2002
> 01-07 2007
> 01-04 2004
> 01-08 2008
> 01-99 1999
> 01-98 1998
> 01-97 1997
> 01-96 1996
>
>

 
Reply With Quote
 
Gary''s Student
Guest
Posts: n/a
 
      18th Feb 2009
If the data goes from 1996 thru 2009 then in B1 enter:

=IF(--RIGHT(A1,2)<10,2000+RIGHT(A1,2),1900+RIGHT(A1,2))
--
Gary''s Student - gsnu200834


"Craig" wrote:

> Hi,
>
> I have one column of text imported into excel that looks like column A
> data...I want to use a function that would give me whats in Column B, that
> is, the year of the last two characters in col A...I tried the year function
> and it worked for 1996-2000, but not for years 2001-2008...it gave me 2009 as
> a result.
>
> Any help appreciated very much
>
> Craig
> col A I want Col B to look like this:
> 01-00 2000
> 01-00 2000
> 01-00 2000
> 01-03 2003
> 01-01 2001
> 01-02 2002
> 01-07 2007
> 01-04 2004
> 01-08 2008
> 01-99 1999
> 01-98 1998
> 01-97 1997
> 01-96 1996
>
>

 
Reply With Quote
 
Pete_UK
Guest
Posts: n/a
 
      18th Feb 2009
Assuming that those are text values, and that the span of years is
from 1931 to 2030, put this formula in B1:

=IF(--RIGHT(A1,2)<=30,2000+RIGHT(A1,2),1900+RIGHT(A1,2))

and copy down as required.

Hope this helps.

Pete

On Feb 18, 4:25*pm, Craig <Cr...@discussions.microsoft.com> wrote:
> Hi,
>
> I have one column of text imported into excel that looks like column A
> data...I want to use a function that would give me whats in Column B, that
> is, the year of the last two characters in col A...I tried the year function
> and it worked for 1996-2000, but not for years 2001-2008...it gave me 2009 as
> a result.
>
> Any help appreciated very much
>
> Craig
> col A * I want Col B to look like this:
> 01-00 * 2000
> 01-00 * 2000
> 01-00 * 2000
> 01-03 * 2003
> 01-01 * 2001
> 01-02 * 2002
> 01-07 * 2007
> 01-04 * 2004
> 01-08 * 2008
> 01-99 * 1999
> 01-98 * 1998
> 01-97 * 1997
> 01-96 * 1996


 
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
converting hours:min:ss to years:days:etc. Meredith Microsoft Excel Programming 2 9th Sep 2009 07:39 PM
Converting date to week number over several years spudsnruf Microsoft Excel Misc 3 2nd Sep 2009 06:35 PM
Converting dates into years james Microsoft Excel Discussion 1 4th Apr 2008 01:23 PM
converting dates to decimal years davidbaker Microsoft Excel Discussion 5 5th Jul 2006 03:35 PM
Converting months to years =?Utf-8?B?a2V2aW4=?= Microsoft Excel Worksheet Functions 1 20th Jan 2005 01:28 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:42 AM.