+ Reply to Thread
Results 1 to 4 of 4

Time in Excel and sorting

  1. #1
    Forum Contributor
    Join Date
    01-28-2013
    Location
    Spencerport, NY
    MS-Off Ver
    Excel 2016
    Posts
    270

    Time in Excel and sorting

    Hello All
    Having a bit of an issue converting time.Attached is the data I am working with

    In column E is the time pulled from an EMR, but when the data is exported, some cells have a blank before the actual time, SO in column K, I used the trim function to rid myself of the blank space, but my result for times between 10:00 and 1:00 appear as a decimal and will not convert to a time in column L. I would like these times to appear as Military time if possible as my objective is to be able to sort the times in chronological order. Any help would be much appreciated
    Thanks
    Ron
    Attached Files Attached Files

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Time in Excel and sorting

    In column K, try

    =TRIM(E2)+0

    And format column K as the Military Time of your choice.

  3. #3
    Forum Contributor
    Join Date
    01-28-2013
    Location
    Spencerport, NY
    MS-Off Ver
    Excel 2016
    Posts
    270

    Re: Time in Excel and sorting

    Thank you very much Jonmo. Can you tell me what the +0 is doing in the formula?

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Time in Excel and sorting

    You're welcome

    The TRIM function returns a TEXT value, but TIME is a numeric (decimal) value, formatting makes it look like a time.

    The +0 is just coercing the Text string into a Numeric Time Value.

+ 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] I require sorting formula in excel sheet with complex sorting.
    By kaminanirav in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-24-2015, 08:16 AM
  2. Sorting by Date / Time
    By fgruhlke in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 06-15-2015, 10:12 AM
  3. extract time from date/time for sorting
    By always Stumped in forum Excel General
    Replies: 3
    Last Post: 01-22-2015, 08:20 PM
  4. Replies: 0
    Last Post: 02-24-2014, 11:27 AM
  5. Time sorting
    By eminthepooh in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-18-2009, 05:41 PM
  6. Sorting, one last time
    By Richard in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-25-2006, 09:30 PM
  7. Sorting by time
    By Student in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 03-21-2005, 05: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