+ Reply to Thread
Results 1 to 9 of 9

How to get last two digit of year?

  1. #1
    Registered User
    Join Date
    05-07-2004
    Posts
    33

    Question How to get last two digit of year?

    How do I get the last two digit of e.g. 2005? I did this:

    Year(1/25/2005)

    and I get 2005 but I want to list it as 05 instead.

    Help is appreciated.

    ljCharlie

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Ljcharlie,

    ShortYear = Format("1/25/2005", "yy")

    Sincerely,
    Leith Ross

  3. #3
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996
    Method 1(retains date value):
    Format the date to only display the 2-digit year
    Forma>Cells>Number Tab
    Category: Custom
    Type: YY


    Method 2(Coverts value to text):
    =TEXT(Year(1/25/2005),"YY")

    I'm sure there are other ways, too.

    Regards,
    Ron

  4. #4
    Registered User
    Join Date
    05-07-2004
    Posts
    33

    Thumbs up

    Thank you very much, it works!

    ljCharlie

  5. #5
    Registered User
    Join Date
    08-06-2019
    Location
    Bangalore
    MS-Off Ver
    2013
    Posts
    1

    Cool Re: How to get last two digit of year?

    =right(year(today()),2)

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: How to get last two digit of year?

    @satishkumar62
    This thread is from 14 years ago. It is highly unlikely the OP is still looking for a solution. Please respond to current situations. Welcome to the Forum. We look forward to your contributions to current issues.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  7. #7
    Registered User
    Join Date
    12-15-2019
    Location
    Not Near you
    MS-Off Ver
    all
    Posts
    1

    Re: How to get last two digit of year?

    The thread might be old but the updated code just helped me. people bumping threads with updates is usually the best help because the threads are long since crawled and indexed.
    Last edited by AliGW; 12-16-2019 at 03:02 AM. Reason: Personal comment removed.

  8. #8
    Registered User
    Join Date
    07-30-2020
    Location
    Bogota, Colombia
    MS-Off Ver
    8
    Posts
    1

    Re: How to get last two digit of year?

    Very helpful, thank you.

  9. #9
    Registered User
    Join Date
    07-08-2019
    Location
    United States
    MS-Off Ver
    Office 365
    Posts
    2

    Re: How to get last two digit of year?

    Thank you! Exactly what I needed!

+ 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