+ Reply to Thread
Results 1 to 12 of 12
  1. #1
    Registered User
    Join Date
    03-09-2010
    Location
    Toronto
    MS-Off Ver
    Excel 2003
    Posts
    5

    Converting text-formatted dates into months

    I have used basic formulas for years but I can't figure out how to do this one at all...

    I have a report that is almost 2000 lines long and has one column that has invoice dates but they are in a 'text' format meaning that I can't use the formating tool to convert them into any other true date format (the original data was pulled from an SAP system)

    What I need to do is extract the month from this column so that I have a column just indicating the month of the transaction

    Sample
    12/23/2009 --> December
    02/12/2009 --> February
    12/02/2009 --> December
    05/10/2009 --> May
    10/05/2009 --> October

    I found some very very basic forumlas but they don't work when you have months with the zero in front (01, 02, 03, etc) and it involves mutlitple forumlas over mutliple columns that you then merge all the results together... not a very good way to do this.

    Any help would be greatly appreciated!
    Last edited by pondorpool; 03-09-2010 at 09:44 PM. Reason: Solved by NBVC - Thanks!

  2. #2
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,163

    Re: Converting text formated dates into months

    Does this work?

    =TEXT(A1,"mmmm")

    where A1 has date entry.
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  3. #3
    Forum Guru darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Colorado, US
    MS-Off Ver
    2007
    Posts
    2,140

    Re: Converting text formated dates into months

    Option B is =A1 and then use a custom format of mmmm.

  4. #4
    Registered User
    Join Date
    03-09-2010
    Location
    Toronto
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Converting text formated dates into months

    nope... neither of those options work. As I mentioned - I can't seem to do anything with formating of the date field in question. When I try the formulas suggested it just returns with the exact same value... ie. A1 12/31/2009 --> A2 =TEXT(A1,"mmmm") --> A3 still shows 12/31/2009

    The way I had started to to this was using an IF statement =IF(ISNUMBER(SEARCH("12/",A3)),"December"," ") which worked for Oct, Nov & Dec but not the other 9 months that showed up as 01, 02,03 in the date field. Besides it meant having to create 12 columns and then merging them to get a complete list (as I said, I understand basic formulas and don't know how to nest functions to get a 12 if then type statement)...

    Any other suggestions?

  5. #5
    Forum Guru darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Colorado, US
    MS-Off Ver
    2007
    Posts
    2,140

    Re: Converting text formated dates into months

    Try putting 1 in a cell, copying that cell, then highlighting column A, Paste Special, multiply, Ok. That should force all the dates into being dates.

  6. #6
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,163

    Re: Converting text formated dates into months

    How about?:

    =TEXT(CLEAN(A1),"mmmm")
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  7. #7
    Registered User
    Join Date
    03-09-2010
    Location
    Toronto
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Converting text formated dates into months

    This just gets weirder and weirder...

    NBVC - your suggestion works kind of... it converted some of the rows but it used the middle value of the date (ie 06/02/2009) so the result was February when it should have been June. For all the rows where the day was greater than 12 then it didn't do anything and simply put the same date in again (06/02/2009). Those new dates are still just text and can't be reformated, converted, etc

    darkyam - your suggestion works kind of... same issue as with NBVC's solution. For some reason when I paste special / multiply it changes the same rows that have a day value of 12 and under but it does nothing for the remaining fields (the ones that it does convert to a number can then be formatted to mmmm to show the month

    Here is sample of the data and what happens using each suggestion

    Date Column NBVC darkyam
    12/31/2009 12/31/2009 12/31/2009
    06/02/2009 February 39850
    07/13/2009 07/13/2009 07/13/2009
    11/07/2007 July 39274
    12/18/2007 12/18/2007 12/18/2007
    06/23/2009 06/23/2009 06/23/2009
    06/24/2009 06/24/2009 06/24/2009
    08/18/2009 08/18/2009 08/18/2009
    09/11/2009 November 40126
    08/18/2009 08/18/2009 08/18/2009
    09/21/2009 09/21/2009 09/21/2009

    I checked again and the entire column is formated as 'General'...

  8. #8
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,163

    Re: Converting text formated dates into months

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  9. #9
    Forum Guru darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Colorado, US
    MS-Off Ver
    2007
    Posts
    2,140

    Re: Converting text formated dates into months

    =Date(Right(A1,4),Left(A1,2),Mid(A1,4,2)), formatted as mmmm or wrapped in a Text formula as NBVC suggests.

  10. #10
    Registered User
    Join Date
    03-09-2010
    Location
    Toronto
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Converting text-formatted dates into months

    Here is a sample worksheet that has 2 of the columns that come standard in the report from SAP and then the other columns that I am trying to calculate (I've included notes explaining what I'm trying to do...)

    Thanks
    Attached Files Attached Files

  11. #11
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,163

    Re: Converting text-formatted dates into months

    My original formula worked right off the bat for me.. but that might be because I located in North America and our date system is different...

    Try this... Select column H and go to Data|Text to columns and skip to the 3rd Dialogue box, select Date from the column data format area and then choose MDY in drop down.. click Finish..

    Does that fix it..? If not, try with DMY...
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  12. #12
    Registered User
    Join Date
    03-09-2010
    Location
    Toronto
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Converting text-formatted dates into months

    Thank you NBVC!!

    It worked after selecting the column and doing the Date|Text conversion using MDY

    The strange thing is I'm just down the road from you in Toronto so I can't figure out why it worked right away on your system and not on mine? My excel is set up to use the default 1900 date system so I'm trying to think about what else could be different?

    Anyways - thanks again!

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.2.0