+ Reply to Thread
Results 1 to 6 of 6

Extracting Month and Year from Date

  1. #1
    Registered User
    Join Date
    05-01-2007
    Posts
    8

    Extracting Month and Year from Date

    There is a column for dates from which i need to get month and year accordingly into another column.

    The temporary solution for me worked out to be

    =CONCATENATE(MONTH(A1),"-",YEAR(A1))

    A1 has a date entered.This would have been fine if it were not for the result in number format i.e. I get something like "5-2007" and I need the display to be just "May - 07"

    Is there any other way for this? And also how to convert the output from Month() function to display Month Name rather than the in number.

    Thanks
    Karthik

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444
    Hi,

    Either use this formula:

    =CHOOSE(MONTH(A1),"January","February","March","April","May","June","July","August","Spetember","October","November","December")&"-"&YEAR(A1)

    or format the date as you want to display it:


    Format > Cells > Number > Custom > mmmm-yyyy
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Try

    =TEXT(A1,"mmmm - yy")

  4. #4
    Registered User
    Join Date
    05-01-2007
    Posts
    8
    thanks a lot daddylonglegs. Worked like a Charm.
    and sweep the formula you had returns an error when coming to year..thanks for the effort though

  5. #5
    Registered User
    Join Date
    07-24-2013
    Location
    new york
    MS-Off Ver
    Excel 2003
    Posts
    62

    Re: Extracting Month and Year from Date

    Hi
    this command worked for me =TEXT(A1,"mmmm - yy"). But then I need to sort it by date and it is not working. I need the dates to be in an ascending order. Any ideas?

    BEst,
    MArvin

  6. #6
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Extracting Month and Year from Date

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    WANT TO SAY THANKS, HIT ADD REPUTATION (*) AT THE BOTTOM LEFT CORNER OF THE POST

    More we learn about excel, more it shows us, how less we know about it.

    for chemistry
    https://www.youtube.com/c/chemistrybyshivaansh

+ 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