Closed Thread
Results 1 to 8 of 8

Return double digit month

  1. #1
    quartz
    Guest

    Return double digit month

    Is there a way to return a two digit month using the MONTH function? i.e. 01,
    02, 03, 04, etc.

    For example, when I try: Format(Month(dteDate), "MM")

    It does not return the correct month...how can I get at this? I'm sure I
    know how to do this, but it's a Monday and I'm dragging...

    Thanks much in advance.

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,518
    try

    Please Login or Register  to view this content.
    " & ' followed by 00"

  3. #3
    Bernie Deitrick
    Guest

    Re: Return double digit month


    Format(Month(dteDate), "00")

    HTH,
    Bernie
    MS Excel MVP


    "quartz" <[email protected]> wrote in message
    news:[email protected]...
    > Is there a way to return a two digit month using the MONTH function? i.e.

    01,
    > 02, 03, 04, etc.
    >
    > For example, when I try: Format(Month(dteDate), "MM")
    >
    > It does not return the correct month...how can I get at this? I'm sure I
    > know how to do this, but it's a Monday and I'm dragging...
    >
    > Thanks much in advance.




  4. #4
    Niek Otten
    Guest

    Re: Return double digit month

    If dteDate is a real date, just use Format(dteDate,"mm")

    --

    Kind Regards,

    Niek Otten

    Microsoft MVP - Excel

    "quartz" <[email protected]> wrote in message
    news:[email protected]...
    > Is there a way to return a two digit month using the MONTH function? i.e.
    > 01,
    > 02, 03, 04, etc.
    >
    > For example, when I try: Format(Month(dteDate), "MM")
    >
    > It does not return the correct month...how can I get at this? I'm sure I
    > know how to do this, but it's a Monday and I'm dragging...
    >
    > Thanks much in advance.




  5. #5
    Registered User
    Join Date
    06-01-2016
    Location
    Zurich
    MS-Off Ver
    Office 2016
    Posts
    9

    Re: Return double digit month

    Hi all,

    I am trying to do the same thing and have the following code:

    Please Login or Register  to view this content.
    However when I step into the Sub and hover the mouse over Month it shows Month = " "
    Does anyone know where I am going wrong? I'm using Excel 2016

    Thanks and best,
    Allen

  6. #6
    Valued Forum Contributor meabrams's Avatar
    Join Date
    10-03-2014
    Location
    USA
    MS-Off Ver
    2007, 2010, 2013, 2016
    Posts
    451

    Re: Return double digit month

    @ allenneukomm Next time please start a new tread so you are not taking over another members thread.... with that said

    change
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    Bramz

  7. #7
    Registered User
    Join Date
    06-01-2016
    Location
    Zurich
    MS-Off Ver
    Office 2016
    Posts
    9

    Re: Return double digit month

    Excellent thanks! That did it!

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

    Re: Return double digit month

    @allenneukomm
    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. Please read our forum rules and comply in the future.
    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

Closed 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