Results 1 to 6 of 6

Thread: Month Name
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Feb 2012
    Posts
    886
    Post Thanks / Like
    Mentioned
    9 Post(s)
    Tagged
    1 Thread(s)

    Default Month Name

    Hi,

    I'm using the following

    Month = FORMAT(MONTH(Sheet1[Date]),"MMMM")

    To get the month name, however, all Jan dates are showing as December, the rest are showing January.

    Any ideas what could be wrong? Sheet1[Date] is a date data type.



    *All good, worked it out.
    Last edited by mrshl9898; Feb 18th, 2019 at 03:24 PM.

  2. #2
    Board Regular
    Join Date
    Feb 2012
    Location
    Florida, USA
    Posts
    11,041
    Post Thanks / Like
    Mentioned
    25 Post(s)
    Tagged
    2 Thread(s)

    Default Re: Month Name

    Didn't notice the last remark.
    Last edited by JLGWhiz; Feb 18th, 2019 at 04:31 PM.
    Using Windows 10, Excel 2013.
    Any code provided by me should be tested on a copy or a mock-up of your file before applying it to your original file. Some actions generated by VBA code cannot be reversed with the undo facility in Excel. To open the VB editor, press Alt + F11. To run code from the Excel window, press Alt + F8. Please do not attempt to learn everything about VBA in one thread, especially from me. See this link for attaching images: Attachments

  3. #3
    Board Regular sandy666's Avatar
    Join Date
    Oct 2015
    Posts
    2,854
    Post Thanks / Like
    Mentioned
    32 Post(s)
    Tagged
    1 Thread(s)

    Cool Re: Month Name

    Quote Originally Posted by mrshl9898 View Post
    = FORMAT(MONTH(Sheet1[Date]),"MMMM")
    maybe:
    Code:
    =FORMAT(MONTH(Table1[Date]),"MMMM")
    edit:
    but if your table has name: Sheet1 so I don't know what is wrong
    Last edited by sandy666; Feb 18th, 2019 at 04:48 PM.
    I know you know but I forgot my Crystal Ball and don't know what you know



    In the first post, show the type of machine (PC / Mac) and the Office version you are working on
    I don't use vba in any form!

  4. #4
    Board Regular
    Join Date
    Feb 2012
    Posts
    886
    Post Thanks / Like
    Mentioned
    9 Post(s)
    Tagged
    1 Thread(s)

    Default Re: Month Name

    It was =FORMAT(Sheet1[Date],"MMMM") in the end.

    Looks like FORMAT(number,"MMMM") works on days of the year by default

    1 = DEC
    2 = JAN
    33 = FEB
    Last edited by mrshl9898; Feb 18th, 2019 at 06:25 PM.

  5. #5
    Board Regular sandy666's Avatar
    Join Date
    Oct 2015
    Posts
    2,854
    Post Thanks / Like
    Mentioned
    32 Post(s)
    Tagged
    1 Thread(s)

    Cool Re: Month Name

    I assume we are talking about the same thing - DAX
    could you tell me what is your table name (table with Date column)?

    I know you know but I forgot my Crystal Ball and don't know what you know



    In the first post, show the type of machine (PC / Mac) and the Office version you are working on
    I don't use vba in any form!

  6. #6
    New Member
    Join Date
    Apr 2015
    Posts
    29
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Month Name

    Quote Originally Posted by sandy666 View Post
    I assume we are talking about the same thing - DAX
    could you tell me what is your table name (table with Date column)?
    This is not the case - OP made a mistake using numbers for month 1..12 and then used Format to get month name which is wrong, as excel needs full date to get month name in the right way. If you want to resolve it in this case you need to change source column to full date or use formula like date() with hardcoded year and day like FORMAT(date(2018, Sheet1[Date], 1), "MMMM") - i'm assuming heare this date column was in fact month stored as number.

    BTW @mrshl9898 - please read this on how excel is storing date http://www.cpearson.com/excel/datetime.htm
    Last edited by ralliartur; Feb 20th, 2019 at 04:21 AM.

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •