+ Reply to Thread
Results 1 to 11 of 11

quick way formatting Mon Day Year HH:MMAM/PM

  1. #1
    Registered User
    Join Date
    05-05-2015
    Location
    Ireland
    MS-Off Ver
    2010
    Posts
    4

    quick way formatting Mon Day Year HH:MMAM/PM

    Hi all,
    I was wondering if somebody could point me in the right direction. I got lots of old data in excel and trying to convert e.g. Apr 10 1947 11:00AM (which seems to be text ) to maybe 10/04/1947 11:00 date format so I can calculate minute difference between two columns.

    from forum search looks like the only way to do this would be format it first by using subtract/replace/substitute before i can subtract two dates?

    Thank you in advance.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: quick way formatting Mon Day Year HH:MMAM/PM

    Hi,

    The first thing to confirm is whether it IS text, or is it a pukka date number.

    Test with =ISTEXT(A1)

    Once we know definitively whether they are text or numbers we'll be able to advise.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: quick way formatting Mon Day Year HH:MMAM/PM

    In a separate cell use

    =(LEFT(SUBSTITUTE(A1," ",", ",2),LEN(A1)-1)&" "&RIGHT(A1,2))*1

    Format cell as mmm dd yyyy hh:mm AM/PM
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  4. #4
    Registered User
    Join Date
    05-05-2015
    Location
    Ireland
    MS-Off Ver
    2010
    Posts
    4

    Re: quick way formatting Mon Day Year HH:MMAM/PM

    Hi Guys , thank you for quick reply.

    Quote Originally Posted by Richard Buttrey View Post
    Hi,

    The first thing to confirm is whether it IS text, or is it a pukka date number.

    Test with =ISTEXT(A1)

    Once we know definitively whether they are text or numbers we'll be able to advise.

    Richard,
    Yes, looks like both columns are definitely text


    Quote Originally Posted by Ace_XL View Post
    In a separate cell use

    =(LEFT(SUBSTITUTE(A1," ",", ",2),LEN(A1)-1)&" "&RIGHT(A1,2))*1

    Format cell as mmm dd yyyy hh:mm AM/PM
    Ace_XL,

    I get wrong data type error when using this query. is an idea to remove all spaces and then convert it?

  5. #5
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: quick way formatting Mon Day Year HH:MMAM/PM

    please attach sample excel file for quick and better results
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: quick way formatting Mon Day Year HH:MMAM/PM

    Quote Originally Posted by Multiscan View Post
    Hi Guys , thank you for quick reply.

    Richard,
    Yes, looks like both columns are definitely text
    In that case you do need to upload the workbook so that we can see the request in context and properly understand the format of the text.

  7. #7
    Registered User
    Join Date
    05-05-2015
    Location
    Ireland
    MS-Off Ver
    2010
    Posts
    4

    Re: quick way formatting Mon Day Year HH:MMAM/PM

    Greatly appreciated!
    Sample now attached
    Attached Files Attached Files

  8. #8
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: quick way formatting Mon Day Year HH:MMAM/PM

    You've got some extra spaces in there..

    Try
    =(LEFT(SUBSTITUTE(TRIM(A2)," ",", ",2),LEN(TRIM(A2))-1)&" "&RIGHT(A2,2))*1

  9. #9
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: quick way formatting Mon Day Year HH:MMAM/PM

    See the attached file
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    05-05-2015
    Location
    Ireland
    MS-Off Ver
    2010
    Posts
    4

    Re: quick way formatting Mon Day Year HH:MMAM/PM

    Guys this is fantastic! this was the last piece of my excel puzzle. wasn't sure how to start on this format. Typically all other date columns are in different format and converted fine but not these two.

    Thank you kindly.

    rgds
    Rob

  11. #11
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: quick way formatting Mon Day Year HH:MMAM/PM

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. Replies: 6
    Last Post: 12-18-2013, 07:17 PM
  2. Replies: 4
    Last Post: 06-23-2011, 11:45 AM
  3. Replies: 0
    Last Post: 09-12-2009, 11:07 AM
  4. Quick formatting for negative numbers
    By Mulepadre in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-24-2006, 11:15 PM
  5. Need quick help formatting cell
    By Morrigan in forum Excel General
    Replies: 1
    Last Post: 06-29-2005, 02: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