+ Reply to Thread
Results 1 to 4 of 4

Text Time to Excel Format, Then Sort Time Past Midnight

  1. #1
    Registered User
    Join Date
    02-21-2011
    Location
    Australia
    MS-Off Ver
    MS Office 2016 on Windows 10
    Posts
    42

    Text Time to Excel Format, Then Sort Time Past Midnight

    I need some advice please:

    I am supplied with a schedule (generated from a server) which lists times in the following format as an example:

    Given Text Time
    2330
    5
    40
    115
    150
    220
    2310
    2340

    Not very neat & tidy! I have a formula that works for every time, except for the hour past midnight. =--(LEFT(C2,LEN(C2)-2)&":"&RIGHT(C2,2)) (thanks to this forum)

    Times such as '5' and '40' result in a #Value! error.

    I also need to sort the times past midnight as in.... 23:30 would come before 00:05

    Any help would be greatly appreciated.
    Attached Files Attached Files

  2. #2
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: Text Time to Excel Format, Then Sort Time Past Midnight

    Hi,

    I have updated the new formula in column E in the attached file. Please see if this suits your requirement.


    Regards,
    Chandra

    Please click on ‘* Add Reputation’ if this was helpful
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    02-23-2014
    Location
    Michigan, US
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Text Time to Excel Format, Then Sort Time Past Midnight

    Using the TEXT function to format the time to 4 digits, inserting a ":" and passing it to the TimeValue function seems to work well:
    Please Login or Register  to view this content.
    PS Having a hard time posting my reply, sorry if it posts twice.

  4. #4
    Registered User
    Join Date
    02-21-2011
    Location
    Australia
    MS-Off Ver
    MS Office 2016 on Windows 10
    Posts
    42

    Re: Text Time to Excel Format, Then Sort Time Past Midnight

    Thanks for the reply guys.

    Chandra - if you copy down the formula it contains errors for some reason. Thanks for taking a look at it.
    SnarlingSheep - Your formula works well. Many Thanks

    Now the problem on how to sort the times past midnight?

+ 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] Time calculation not working past midnight
    By Sophie.Durrant in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-08-2014, 08:18 PM
  2. [SOLVED] Calculating time that goes past Midnight
    By jonvanwyk in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-27-2013, 04:14 PM
  3. Replies: 4
    Last Post: 01-11-2012, 07:59 PM
  4. Calculate time which is past midnight
    By stoey in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 08-25-2011, 12:11 PM
  5. [SOLVED] Calculating Time Past Midnight
    By Darren in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-13-2006, 11:03 AM

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