+ Reply to Thread
Results 1 to 6 of 6

Formula to return year of date in a cell

  1. #1
    Forum Contributor
    Join Date
    06-23-2005
    Posts
    253

    Formula to return year of date in a cell

    Need a formula in cell C3 to show the last two digits of the year of a date in cell B2.

    For example:

    B2 = 12/31/2007 Need C3 = the number 07 or 7

    or

    B2 = 12/31/1997 Need C3 = the number 97

    etc.

    I tried putting in C3 =Right(B2, 2) but I get weird numbers.

    Thanks for all you help. mikeburg

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try

    =TEXT(B2,"yy")

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Or

    =B2 then custom format the cell to "yy"
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    or

    =RIGHT(YEAR(B2),2)

    VBA Noob

  5. #5
    Forum Contributor
    Join Date
    06-23-2005
    Posts
    253
    Hey, thanks a million. You are a life saver.

    mikeburg

  6. #6
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    No problem

    Thx for the feedback

    VBA Noob

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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