+ Reply to Thread
Results 1 to 10 of 10

Getting Excel to recognize a "mm/yy" entry

Hybrid View

  1. #1
    Registered User
    Join Date
    11-27-2012
    Location
    WA
    MS-Off Ver
    Excel 2010
    Posts
    5

    Getting Excel to recognize a "mm/yy" entry

    I have a dataset that looks like this (image attached, I hope). excelscreenshot.png

    I think that Excel is currently recognizing this as text rather than numbers. These numbers are dates, with the digits before the slash referring to a month and the digits after the slash referring to a year. I cannot get excel to recognize this. I have spent an hour or so messing around with "format cells" but the only thing Excel wants to do is attach a "2012" on the end of my dates -- EG rather than realizing I mean "June 2008" in the first row, it thinks I mean "June 8, 2012."

    I think the problem is compounded by the fact that some of these dates have a leading zero (like 06/08) and some don't (9/10). When I try to standardize this, Excel again jumps on adding a "2012" to everything.

    I would greatly appreciate any suggestions that don't involve me manually editing 15,000 cells Thanks in advance.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Getting Excel to recognize a "mm/yy" entry

    not every1 can open .png files, myself included. It would be far better if you could upload a sample of your file, showing what you have, and an example of your expected outcome. Thanks

    assuming you're data is in column A, use this...
    =DATE(2012,LEFT(A14,SEARCH("/",A14,1)-1),1)

    if you want the actual days too, change it to this...
    =DATE(2012,LEFT(A14,SEARCH("/",A14,1)-1),DAY(RIGHT(A14,1)))

    either way format to just month/year

    hope this helps?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Getting Excel to recognize a "mm/yy" entry

    Quote Originally Posted by FDibbins View Post
    not every1 can open .png files, myself included. It would be far better if you could upload a sample of your file, showing what you have, and an example of your expected outcome. Thanks
    you have already shown us that pic, and copied the same to here. what i said was that you need to copy the formula to an empty cell, next to you're data. so, if you're data is in column A, starting from A1, then in B2 (if that is in use, pick any empty cell/column) copy my formula there, and then copy it down as far as you need.

    if you still have a problem, upload a sample WORKBOOK please

  4. #4
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Getting Excel to recognize a "mm/yy" entry

    With my European date set up the following works

    = DATEVALUE("1/" & A1) in B1 and format mm/yy

    For the US format you might try

    =DATEVALUE(LEFT(A1,FIND("/",A1)) & "1/" & RIGHT(A1,LEN(A1)-FIND("/",A1)))

  5. #5
    Registered User
    Join Date
    11-27-2012
    Location
    WA
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Getting Excel to recognize a "mm/yy" entry

    Here is an example of my data copied & pasted. I just want to be able to sort oldest to newest & have excel properly recognize that I mean month and year, not date/month.


    06/08
    9/10
    7/13
    9/09
    1/11
    3/14
    4/11
    6/11
    07/06
    5/09
    4/12
    10/07
    5/10
    6/13
    06/07
    11/06
    05/08
    9/09

  6. #6
    Registered User
    Join Date
    11-27-2012
    Location
    WA
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Getting Excel to recognize a "mm/yy" entry

    Thanks. Where do I type this in?

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Getting Excel to recognize a "mm/yy" entry

    in any blank next to the entry, copy down.

    once you have the answer you want, you can copy/paste values from the formula to the original data, then delete the formulas if you want

  8. #8
    Registered User
    Join Date
    11-27-2012
    Location
    WA
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Getting Excel to recognize a "mm/yy" entry

    Thanks, but I'm completely lost regarding what you're saying. This is what my data looks like -- http://i.imgur.com/UcHVH.png -- but it extends for 15,000 rows. The column I am trying to fix is E. Right now Excel has no idea that those are dates (mm/yy) and so when I try to sort, it doesn't work. I just want Excel to treat these entries as mm/yy dates.

  9. #9
    Registered User
    Join Date
    11-27-2012
    Location
    WA
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Getting Excel to recognize a "mm/yy" entry

    I used the clickable link so that you would be able to open it.

    Anyway, here is my file. excel sample 1.xlsx

    I used the first empty cell (which was E8) to put the formula in.

    Thanks for your help

  10. #10
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,421

    Re: Getting Excel to recognize a "mm/yy" entry

    Insert a new column F, by clicking on the F to highlight the complete column and then clicking on <Insert>. This is just a temporary measure, as you will delete column E at the end to restore the structure of your data.

    Then put this formula in the new F2:

    Formula: copy to clipboard
    =IF(E2="","",DATE(2000+RIGHT(E2,2),LEFT(E2,FIND("/",E2)-1),1))


    Format that cell how you would like it to appear (eg using a Custom Format of m/yy to make it look like the same as E2).

    Then copy that formula all the way down to the bottom of your data.

    Then highlight column F again, click on <copy>, then right-click and choose Paste Special, then click against Values, then click OK, then press the <Esc> key. This will now have fixed those values, and so you can highlight column E and click on <Delete>.

    Then you should be able to sort your data in a meaningful way.

    Hope this helps.

    Pete

+ 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