+ Reply to Thread
Results 1 to 7 of 7

Reformat a Date?

  1. #1
    Forum Contributor
    Join Date
    01-25-2010
    Location
    Virginia
    MS-Off Ver
    Excel 2013
    Posts
    104

    Reformat a Date?

    I've been given a file to work with that has date values formatted like this:

    Fri Jul 20 12:02:35 EDT 2012

    I want them formatted like this (as Date values):

    Jul 20 2012

    I've tried a number of ways to do this, but can't seem to get it working. Can someone help me?
    Last edited by SueWithQuestion; 07-30-2012 at 07:16 AM.

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Reformat a Date?

    hi there, i'm assuming your other data has the same format. if you want it to show just as text, you can try:
    =MID(A1,5,3)&" "&MID(A1,9,2)&" "&RIGHT(A1,4)

    if you need it as an Excel-recognised date, try:
    =DATE(RIGHT(A1,4),VLOOKUP(MID(A1,5,3),$G$1:$H$12,2,0),MID(A1,9,2))

    then to format as your desired format, right-click & Format Cells -> Custom Format -> mmm dd yyyy

    hope that helps

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

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

    Re: Reformat a Date?

    Quote Originally Posted by benishiryo View Post
    ... VLOOKUP(MID(A1,5,3),$G$1:$H$12,2,0), ...
    You should have pointed out that this would need a table setting up in G1:H12 containing the month abbreviations in column G and the month numbers in column H - actually, you could have just used MATCH on column G and not needed column H.

    Hope this helps.

    Pete

  4. #4
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Reformat a Date?

    @Pete_UK

    thanks for pointing that out. forgot about that

  5. #5
    Forum Contributor
    Join Date
    01-25-2010
    Location
    Virginia
    MS-Off Ver
    Excel 2013
    Posts
    104

    Re: Reformat a Date?

    Thank you VERY much!

    I do need it as an Excel date.

    I don't understand the $G$1:$H$12 portion of the formula, so I haven't gotten this working yet. What's going on there?



    Quote Originally Posted by benishiryo View Post
    hi there, i'm assuming your other data has the same format. if you want it to show just as text, you can try:
    =MID(A1,5,3)&" "&MID(A1,9,2)&" "&RIGHT(A1,4)

    if you need it as an Excel-recognised date, try:
    =DATE(RIGHT(A1,4),VLOOKUP(MID(A1,5,3),$G$1:$H$12,2,0),MID(A1,9,2))

    then to format as your desired format, right-click & Format Cells -> Custom Format -> mmm dd yyyy

    hope that helps

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

    Re: Reformat a Date?

    Quote Originally Posted by SueWithQuestion View Post
    I don't understand the $G$1:$H$12 portion of the formula, so I haven't gotten this working yet. What's going on there?
    Hi Sue,

    my post #3 was aimed as much at you as it was to benishiryo - you need to set up a list of 3-letter months in column G and then put the numbers 1, 2, 3, etc next to them in column H.

    OR, you could put his first text-based date formula within DATEVALUE( ).

    Hope this helps.

    Pete

  7. #7
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Reformat a Date?

    as Pete mentioned, i actually used that placed month Jan-Dec in G1:G12 to lookup & return a month number placed in H1:H12. you can also use what he suggested. a MATCH formula instead. same thing. put the months Jan-Dec in G1:G12 & do this formula:
    =DATE(RIGHT(A1,4),MATCH(MID(A1,5,3),$G$1:$G$12,0),MID(A1,9,2))

+ 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