+ Reply to Thread
Results 1 to 6 of 6

Thread: Dates in excel

  1. #1
    Registered User
    Join Date
    08-03-2011
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    1

    Dates in excel

    Hi all
    I'm having trouble with dates in excel. I have a list of dates in the format 03/29/2005 and want to output the year only from this. using the command:
    =REPLACE(A1,1,6,)
    works for most of them, but not if the date has a zero in it (eg for march=03). Any ideas?

    Thanks
    Kate

  2. #2
    Forum Guru ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    traded up
    MS-Off Ver
    2003 & 2010
    Posts
    1,905

    Re: Dates in excel

    Hi Kate,

    How about:

    =RIGHT(A1,4)
    Cheers,
    “To sin by silence when they should protest makes cowards of men.” ~ Abraham Lincoln

  3. #3
    Forum Guru, retired Admin royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    25,640

    Re: Dates in excel

    Why not just format as "yyyy". If you actually want the year, then create a helper column that uses
    =Year(A1)
    Hope that helps.

    RoyUK
    --------
    If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need

    For Excel Tips & Solutions, free examples and tutorials why not check out my downloads

    New members please read & follow the Forum Rules

    Remember to mark your questions Solved and rate the answer(s)

  4. #4
    Forum Guru ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    traded up
    MS-Off Ver
    2003 & 2010
    Posts
    1,905

    Re: Dates in excel

    I guess it depends if "mm/dd/yyyy" is in your operating system as a recognized date format.

    In my case it is not, therefore Excel thinks "03/29/2005" is a text string.
    “To sin by silence when they should protest makes cowards of men.” ~ Abraham Lincoln

  5. #5
    Forum Guru, retired Admin royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    25,640

    Re: Dates in excel

    mm/dd/yyyy would be a Custom Format. If it is formatted as text then it would be a string.

    All Excel dates are actually numbers, appearance is achieved by Formatting. If you enter today's date then format it as a number it will be 40759.

    That's why I would use the YEAR() Function, or a custom format of yyyy
    Hope that helps.

    RoyUK
    --------
    If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need

    For Excel Tips & Solutions, free examples and tutorials why not check out my downloads

    New members please read & follow the Forum Rules

    Remember to mark your questions Solved and rate the answer(s)

  6. #6
    Valued Forum Contributor gjlindn's Avatar
    Join Date
    08-01-2011
    Location
    Dodgeville, WI
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    351

    Re: Dates in excel

    If you're looking for a text value you could use =TEXT(A1,"YYYY"). If you only want it to be a number with no association to a date then =VALUE(TEXT(A1,"YYYY")).
    Last edited by gjlindn; 08-04-2011 at 03:01 AM.
    -Greg If this is helpful, pls click Star icon in lower left corner

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0