+ Reply to Thread
Results 1 to 8 of 8

Search dates in column A and return 'year' in column B

  1. #1
    Registered User
    Join Date
    07-21-2008
    Location
    New Zealand
    Posts
    35

    Search dates in column A and return 'year' in column B

    Hi,
    Given a column containing dates (formatted as dd/mm/yy), how can i get excel to examine these and return the year in another column?

    e.g., if column A has:
    01/02/05
    06/04/07
    and so on another 17 thousand times...

    how can i output in column B (i.e. as a number):
    2005
    2006
    and so on....

    Thanks in advance

  2. #2
    Registered User
    Join Date
    07-22-2008
    Location
    DELHI
    Posts
    11
    Hi
    place this code in module
    and use rt function it will work for u

    pankaj kaushik


    Function rt(t As Date)
    rt = Year(t)

    End Function

  3. #3
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326
    Alternatively you can use the YEAR function provided with XL.
    (BTW XL as a search function accessed with F1 with which you can find lots of info)
    Cheers

  4. #4
    Valued Forum Contributor Richard Schollar's Avatar
    Join Date
    05-23-2006
    Location
    Hampshire UK
    MS-Off Ver
    Excel 2002
    Posts
    1,264
    If it is just for display purposes then you could simply have (in B1 for eg):

    =A1

    and format the B column via Format>Cells>Number Tab>Custom

    yyyy

  5. #5
    Registered User
    Join Date
    07-21-2008
    Location
    New Zealand
    Posts
    35
    Thanks to all who answered.

    "=Year(A2)" was exactly what I needed

    Cheers

  6. #6
    Registered User
    Join Date
    07-21-2008
    Location
    New Zealand
    Posts
    35
    Incidentally, when I try "=MONTH" excel gives me "January" for the date 03 July 2003
    Attached Images Attached Images

  7. #7
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326
    Hi,
    you'll find an explanation here

    HTH

    Cheers
    Last edited by arthurbr; 08-20-2008 at 02:42 AM.

  8. #8
    Registered User
    Join Date
    07-21-2008
    Location
    New Zealand
    Posts
    35
    cheers mate

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Leap year calculations
    By SiameseTurtle in forum Excel General
    Replies: 7
    Last Post: 08-02-2008, 09:48 PM
  2. How can i search for multiple values to return 1 result using vlookup?
    By buzf355 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-12-2008, 04:11 PM
  3. How can i search for multiple values to return 1 result using vlookup?
    By buzf355 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-11-2008, 06:28 PM
  4. IF A date between x&y dates return date B
    By Mishka1 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-18-2007, 07:35 AM
  5. Search array for text, return column #
    By Spreadsheet in forum Excel General
    Replies: 5
    Last Post: 05-09-2007, 12:30 PM

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.6.0 RC 1