+ Reply to Thread
Results 1 to 5 of 5

Convert date into month format not working

  1. #1
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Convert date into month format not working

    This is just baffling me.....

    I am using Excel 2003 for this. - I have a set of dates in column A in the format - dd-mmm-yy (eg. 03-Nov-11). I want to extract the month from these dates, so i used the formula =month(A1) and i got 11. So far so good.
    Then i wanted the 11 to show as "Nov". So i custom formatted the cell B1 (containing 11) to mmm. This gave me "Jan". Which is utterly weird. Why should it give me Jan?

    On the contrary, if i use the "Choose" function, it works properly. Why doesnt it work in the first case?
    Last edited by arlu1201; 11-08-2011 at 11:48 AM.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Convert date into month format not working

    why not just use = a1 formatted as mmm?
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Convert date into month format not working

    Martin....this is cool....i never thought of that...sometimes we just overlook the small details and go after the big ones..

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

    Re: Convert date into month format not working

    Quote Originally Posted by arlu1201 View Post
    Why should it give me Jan?
    Excel counts dates from 1st jan 1900 so 11 - treated as a date is 11th Jan 1900, hence "Jan" when you format as "mmm". To get Nov you need to format the date as mmm, so you can do that in B1 by using just

    =A1

    and formatting as mmm

    or you can use this formula in B1

    =TEXT(A1,"mmm")

    The display is the same but the second is text rather than a formatted date.....
    Audere est facere

  5. #5
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Convert date into month format not working

    Thanks daddylonglegs......this was really making me mad...when it should have worked if you look at it literally...

+ 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