+ Reply to Thread
Results 1 to 16 of 16

Convert Date in mmm yyyy format

  1. #1
    Valued Forum Contributor
    Join Date
    02-07-2013
    Location
    Philippines
    MS-Off Ver
    Excel Online; 365
    Posts
    610

    Convert Date in mmm yyyy format

    Hi Experts,



    I use this formula to extract the month and year

    =MONTH(A2)*28&" "&YEAR(A2)

    but it gives me 28 2023 instead of 1 2023 (date in A2 is 1/9/2023)


    I do not want to use =TEXT() at it will skew the sorting in the pivot table

    Please help
    If I've helped U pls click on d *Add Reputation

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,915

    Re: Convert Date in mmm yyyy format

    Why do you expect 1 when you are multiplying the month (1 for Jan presumably) by 28 in the formula?
    Rory

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,064

    Re: Convert Date in mmm yyyy format

    either;

    =TEXT(a2,"m yyyy")

    or CTRL-F1,more formats and format A2 as m yyyy
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: Lá fhéile Pádraig sona dhaoibh

  4. #4
    Registered User
    Join Date
    07-14-2023
    Location
    Maldives
    MS-Off Ver
    Office Standard 2013
    Posts
    3

    Re: Convert Date in mmm yyyy format

    Use this formula:

    =DAY(A2)&" "&TEXT(A2, "yyyy")

  5. #5
    Valued Forum Contributor
    Join Date
    02-07-2013
    Location
    Philippines
    MS-Off Ver
    Excel Online; 365
    Posts
    610

    Re: Convert Date in mmm yyyy format

    I use this formula for another column to extract the month and show it in the mmm format


    Is their a way to extract mmm yyyyy from a date without using =TEXT?

  6. #6
    Forum Expert CheeseSandwich's Avatar
    Join Date
    12-22-2021
    Location
    Kent, England
    MS-Off Ver
    365 - 2402-17328.20068
    Posts
    1,361

    Re: Convert Date in mmm yyyy format

    Quote Originally Posted by bhenlee View Post
    I use this formula for another column to extract the month and show it in the mmm format


    Is their a way to extract mmm yyyyy from a date without using =TEXT?
    Read post 3, pay attention to the bit after the word 'or'
    Last edited by CheeseSandwich; 07-14-2023 at 05:04 AM. Reason: typo
    If things don't change they stay the same

  7. #7
    Valued Forum Contributor
    Join Date
    02-07-2013
    Location
    Philippines
    MS-Off Ver
    Excel Online; 365
    Posts
    610

    Re: Convert Date in mmm yyyy format

    I will need to use the date extracted in a pivot table.. if I used text its not going to be sorted properly and if i simply change the format it will show all the day in the month instead of showing just the month total

  8. #8
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,915

    Re: Convert Date in mmm yyyy format

    Group it in the pivot table.

    Any of these options will produce text. If you need it sortable in date order, either produce the same day of the month for all dates in a month:

    =DATE(YEAR(A2),Month(A2),1)

    for example (or use EOMONTH), or use a format that will sort correctly like YYYY-MM-DD

    Using real dates is generally better.

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,064

    Re: Convert Date in mmm yyyy format

    Post a sample file showing EXACTLY what you want. We are going round in circles.

  10. #10
    Forum Expert CheeseSandwich's Avatar
    Join Date
    12-22-2021
    Location
    Kent, England
    MS-Off Ver
    365 - 2402-17328.20068
    Posts
    1,361

    Re: Convert Date in mmm yyyy format

    How about including two columns in your data with formulae like:

    =MONTH(A1)
    &
    =YEAR(A1)

    And using those in your filters.

  11. #11
    Valued Forum Contributor
    Join Date
    02-07-2013
    Location
    Philippines
    MS-Off Ver
    Excel Online; 365
    Posts
    610

    Re: Convert Date in mmm yyyy format

    i need to extract the month and year from a date in A1..

    I need it to be NOT in TEXT format so it will be automatically sorted in the pivot table

  12. #12
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,064

    Re: Convert Date in mmm yyyy format

    See Post 9.

  13. #13
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,064

    Re: Convert Date in mmm yyyy format

    Try this. See file.

    Last guess without getting a sample file...
    Attached Files Attached Files

  14. #14
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,215

    Re: Convert Date in mmm yyyy format

    For sorting:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  15. #15
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,435

    Re: Convert Date in mmm yyyy format

    The multiplication by 28 in Post #1 makes sense when you want to convert a month number to a name of a month.

    Example 1:
    A3: 4.
    B3: =28*A3.
    Format B3 as mmmm
    ==> Result B3: 112, but shows "April".

    Example 2:
    A3: 4.
    B3: =TEXT(28*A3,"mmmm").
    ==> Result B3: "April".

  16. #16
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,914

    Re: Convert Date in mmm yyyy format

    Or try:

    =TEXT(A1,"yyyymm")+0

+ 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. Convert Date in DD.MM.YYYY to DD/MM/YYYY format
    By abhinavbinkar in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 01-21-2019, 07:18 AM
  2. Convert Date format from Text format reading m/d/yyyy to dd/mm/yyyy
    By bridge4444 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-23-2017, 11:22 PM
  3. [SOLVED] How to Convert date format ( DD/MM/YYYY) into MM/YYYY
    By PRADEEPB270 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-04-2014, 07:25 AM
  4. convert date in yyyy/mm/dd format
    By abraham30 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-12-2013, 05:40 AM
  5. [SOLVED] Convert date format to (dd/mm/yyyy)
    By nur2544 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-11-2013, 09:40 AM
  6. [SOLVED] Convert Date Format from yyyy-mm-dd to dd mmm yy using VBA
    By longbow007 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-25-2012, 07:36 AM
  7. [SOLVED] Imported data contains strings dd.mm.yyyy how can I convert to date format dd/mm/yyyy inVB
    By Boormo in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-05-2012, 05:48 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