+ Reply to Thread
Results 1 to 11 of 11

Convert date formats mmm-yy to dd-mm-yy

  1. #1
    Registered User
    Join Date
    05-29-2012
    Location
    Toronto
    MS-Off Ver
    Excel 2011
    Posts
    5

    Convert date formats mmm-yy to dd-mm-yy

    Hi, I would really appreciate your help with this issue:

    I have a column with months and years coded as mmm-yy (eg Sep-07). I want to convert this into numbers to compare with another date field. However, when I do that, excel thinks that Sep-07 (September 2007) is really 7th September, 2012. How can I get around this?

    Ps: I have already tried to format the cells as mmm-yy, Datevalue, multiplying the column by 1 and pasting, using text to date and none of these seem to work.

    Thanks so much for your help!

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,058

    Re: Convert date formats mmm-yy to dd-mm-yy

    Would this help:

    =--(A1&"-2012")

    and then format as you like
    Never use Merged Cells in Excel

  3. #3
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Convert date formats mmm-yy to dd-mm-yy

    I was thinking

    =DATE(2000+RIGHT(A2,2),MATCH(LEFT(A2,3),{"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Dec"},0),1)

  4. #4
    Registered User
    Join Date
    05-29-2012
    Location
    Toronto
    MS-Off Ver
    Excel 2011
    Posts
    5

    Re: Convert date formats mmm-yy to dd-mm-yy

    That gives me an error (zbor)...

  5. #5
    Registered User
    Join Date
    05-29-2012
    Location
    Toronto
    MS-Off Ver
    Excel 2011
    Posts
    5

    Re: Convert date formats mmm-yy to dd-mm-yy

    Thanks Cutter, but again, it does not seem to be working - maybe because there is a hyphen between LEFT and RIGHT (Sep-07)?

  6. #6
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2504
    Posts
    13,631

    Re: Convert date formats mmm-yy to dd-mm-yy

    Is Sep-07 a text or a format?

  7. #7
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Convert date formats mmm-yy to dd-mm-yy

    The formula works on "Sep-07". Might there be leading or trailing spaces in your data?

  8. #8
    Registered User
    Join Date
    05-29-2012
    Location
    Toronto
    MS-Off Ver
    Excel 2011
    Posts
    5

    Re: Convert date formats mmm-yy to dd-mm-yy

    Quote Originally Posted by Pepe Le Mokko View Post
    Is Sep-07 a text or a format?
    It is in text currently. I tried to convert it to "custom" mmm-yy format but that does not seem to work.

  9. #9
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2504
    Posts
    13,631

    Re: Convert date formats mmm-yy to dd-mm-yy

    Quote Originally Posted by acjarus View Post
    It is in text currently. I tried to convert it to "custom" mmm-yy format but that does not seem to work.
    And it shouldn't if it's text
    Maybe post a small sample of your real data ?

  10. #10
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Convert date formats mmm-yy to dd-mm-yy

    And the answer to:
    Might there be leading or trailing spaces in your data?
    is.............?

  11. #11
    Registered User
    Join Date
    05-29-2012
    Location
    Toronto
    MS-Off Ver
    Excel 2011
    Posts
    5

    Re: Convert date formats mmm-yy to dd-mm-yy

    Quote Originally Posted by Cutter View Post
    And the answer to:

    is.............?
    There are no spaces before or after the mmm-yy entries. I will post a sample shortly. Tanks for all your help guys!

+ 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