+ Reply to Thread
Results 1 to 5 of 5

Trying to convert dates into a better format

  1. #1
    Registered User
    Join Date
    02-05-2013
    Location
    Hong Kong
    MS-Off Ver
    Excel 2010
    Posts
    56

    Trying to convert dates into a better format

    In the attached file the dates are shown separated by dots (full stops if you like). Some dates are clearly number, month and year, whilst others are just month and year.

    I would like to see the dates as: day number, month as the first three letters of which ever month, and the year in the usual format.

    I have tried Custom format to alter things and that does not seem to want to work.

    Can anyone offer a solution.

    Relevant file attached.

    Dave
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    11-13-2006
    Posts
    87

    Re: Trying to convert dates into a better format

    If it is an occasional task, use a helper column with this formula in row 4 and copy it down
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Then PasteSpecial(Values) the helper column into the Date column.

    If you have to do this very often, use an .xlsm Workbook with a modified-to-fit version of this macro
    Please Login or Register  to view this content.
    Finally, format the cells to the date format you want.

    I tested the formula, but, because I use US date formats, I can't test the Sub without a lot more work.
    Last edited by SamT; 03-27-2014 at 08:15 PM. Reason: typ0s

  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
    52,939

    Re: Trying to convert dates into a better format

    Sam, not sure that will work. Those "dates" are actually text, and many do not have a day included.

    Try this, copied down...
    =IF(C4="","",DATE(RIGHT(C4,4),IF(LEN(C4)=7,LEFT(C4,2),MID(C4,4,2)),IF(LEN(C4)=7,1,LEFT(C4,2))))

    This will do column C for you, copy the formula to 2 columns over for column E

    If you want to have the dates back into C and E, copy/paste values from the formulas to C and E
    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

  4. #4
    Registered User
    Join Date
    02-05-2013
    Location
    Hong Kong
    MS-Off Ver
    Excel 2010
    Posts
    56

    Re: Trying to convert dates into a better format

    Thank you Mr Dibbins.

    Your clever advice worked for the first date column but not the second.

    Instead, I converted the second column manually to avoid wasting your precious time.

    Regards,

    Dave

  5. #5
    Registered User
    Join Date
    11-13-2006
    Posts
    87

    Re: Trying to convert dates into a better format

    Well, "Substitute" being a text function, I assumed that even the non US Date formatted strings would convert to UK formatted date strings on a system using that format.

    All the strings containing only the UK months and years converted nicely to US months and years. Obviously, a string like "30.3.1948" would not convert for me, but "3.48" converted to Mar, 1948. (When Formatted "mmm,yyyy". "mmm,dd,yyyy" gave Mar 01,1948.

    I'm either going to have to give up my VBA hobby, or spend a few months updating my personal programming manual from <=2003 to <=2013, and I much prefer coding VBA than writing about it.

  6. #6
    Registered User
    Join Date
    12-15-2012
    Location
    In a bin
    MS-Off Ver
    Excel 2013
    Posts
    43

    Re: Trying to convert dates into a better format

    Another version

    Formula: copy to clipboard
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Convert Dates in 2011:08:17 format into Dates in Excel
    By JessRI in forum Excel - New Users/Basics
    Replies: 12
    Last Post: 09-11-2012, 09:55 AM
  2. CONVERT DATES FROM EUROPEAN FORMAT TO US FORMAT
    By les8 in forum Excel - New Users/Basics
    Replies: 13
    Last Post: 08-08-2006, 12:50 PM
  3. How to convert the dates from the YY:DD forma to MM/dd/YYYY format
    By JE McGimpsey in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 09-06-2005, 04:05 AM
  4. How to convert the dates from the YY:DD forma to MM/dd/YYYY format
    By Sam in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  5. How to convert the dates from the YY:DD forma to MM/dd/YYYY format
    By Sam in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM

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