+ Reply to Thread
Results 1 to 4 of 4

Date & time format conversion

  1. #1
    Forum Contributor
    Join Date
    01-26-2018
    Location
    London, England
    MS-Off Ver
    365
    Posts
    311

    Date & time format conversion

    Hi all,

    I'm trying to find an efficient way of converting an ugly date & time format.

    The raw data arrives as: "Tue, Dec 28, 2021, 11:36 AM (7 days ago)" & I'm trying to convert it into: "28/12/2021" & "11:00" (sheet included below, with multiple examples)

    Annoyingly =Month =Day =Hour etc don't seem to like the data

    Thanks
    Mdn
    Attached Files Attached Files

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Date & time format conversion

    These two formulas shown in column D and E below will do it.

    Values as displayed
    A
    B
    C
    D
    E
    1
    Date & Time
    Date
    Time (hour)
    2
    Tue, Dec 28, 2021, 11:36 AM (7 days ago)
    12/28/2021
    11:00
    12/28/2021
    11:00
    Underlying formulas
    A
    B
    C
    D
    E
    1
    Date & Time
    Date
    Time (hour)
    2
    Tue, Dec 28, 2021, 11:36 AM (7 days ago)
    44558
    0.458333333333333
    =DATEVALUE(MID(A2,6,FIND(",",A2,13)-6))
    =TIME(HOUR(TIMEVALUE(MID(A2,FIND(",",A2,13)+2,8))),0,0)
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor
    Join Date
    01-26-2018
    Location
    London, England
    MS-Off Ver
    365
    Posts
    311

    Re: Date & time format conversion

    Cheers Jeff

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Date & time format conversion

    I should have mentioned this but I guess you sorted it. The dates you see are U.S. because that's just the way they are displayed for me. The same formula will give you d/m/yyyy format.

+ 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. [SOLVED] 13 digit date / time conversion specific to time zone
    By drgkt in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 12-30-2021, 12:26 PM
  2. [SOLVED] Cell conversion to time format is this even possible?
    By tisimp14 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-22-2016, 02:29 PM
  3. [SOLVED] Time Conversion from Decimal time format
    By bigroo1958 in forum Excel General
    Replies: 2
    Last Post: 08-09-2016, 12:23 PM
  4. Date Conversion Format
    By IMA_Saihat in forum Tips and Tutorials
    Replies: 0
    Last Post: 11-11-2015, 08:46 AM
  5. [SOLVED] Time cell format no standard problem conversion
    By Shami00 in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 02-13-2015, 01:27 PM
  6. Replies: 1
    Last Post: 06-15-2012, 02:03 PM
  7. Time format conversion
    By TimmerSuds in forum Excel General
    Replies: 3
    Last Post: 03-07-2007, 04:17 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