+ Reply to Thread
Results 1 to 9 of 9

Sort Values

  1. #1
    Registered User
    Join Date
    04-23-2013
    Location
    Chennai, India
    MS-Off Ver
    Office 365
    Posts
    62

    Thumbs up Sort Values

    Hi,

    Please help me sort the following,

    53 days 2 hrs 15 mins
    29 days 2 hrs 28 mins
    31 days 8 hrs 34 mins
    18 days 0 hrs 19 mins
    19 days 3 hrs 5 mins
    11 days 4 hrs 26 mins
    2 days 20 hrs 43 mins
    2 days 15 hrs 15 mins
    4 days 21 hrs 24 mins
    1 days 19 hrs 30 mins
    1 days 16 hrs 0 mins
    1 days 15 hrs 49 mins
    28 days 7 hrs 28 mins
    6 days 7 hrs 21 mins


    You're help is much appreciated.
    Last edited by jebindavidson; 04-03-2018 at 12:32 AM. Reason: Resolved

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,645

    Re: Sort Values

    Assuming data starts from A1, one space between words.
    Try in B1 then copy down:
    Please Login or Register  to view this content.
    Sort by column B

    Untitled.png
    Quang PT

  3. #3
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Sort Values

    or
    B2: =IF(LEN(LEFT(A2,SEARCH(" ",A2)-1))<2,"0"&LEFT(A2,SEARCH(" ",A2)-1),LEFT(A2,SEARCH(" ",A2)-1))
    and drag down
    then select both and sort by B column
    Attached Files Attached Files

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,645

    Re: Sort Values

    Quote Originally Posted by sandy666 View Post
    or
    B2: =IF(LEN(LEFT(A2,SEARCH(" ",A2)-1))<2,"0"&LEFT(A2,SEARCH(" ",A2)-1),LEFT(A2,SEARCH(" ",A2)-1))
    and drag down
    then select both and sort by B column
    @sandy:
    You paid no attention to Hrs and Mins!

  5. #5
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Sort Values

    @bebo021999
    Yeah it was bad idea
    I tried to delete it but you was faster so it will stay with shame on me

  6. #6
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: Sort Values

    @jebindavidson.... I would convert them to Excel time by entering the following into an adjacent column:

    =LEFT(A1,FIND(" ",A1)) + VALUE(MID(A1,FIND("hr",A1)-3,3) & ":" & MID(A1,FIND("min",A1)-3,3))

    Then select the two columns of data, and sort based on the second column.

    For example, select A1:B14, click Data > Sort, select:

    Sort by: B
    Sort on: Values
    Order: smallest to largest or largest to smallests

  7. #7
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Sort Values

    but this one is correct

    (done with PowerQuery - add-in for Ex2010 is required)
    Attached Files Attached Files

  8. #8
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: Sort Values

    =sum(iferror(mid(a2,row(indirect("1:"&len(a2))),1)*10^(22-row(indirect("1:"&len(a2)))),)) cse

  9. #9
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2503
    Posts
    13,702

    Re: Sort Values

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


    One other way ... array entered ...
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    A
    B
    C
    D
    1
    1 days 15 hrs 49 mins
    2389
    2389
    2
    1 days 16 hrs 0 mins
    2400
    2400
    3
    1 days 19 hrs 30 mins
    2610
    2610
    4
    2 days 15 hrs 15 mins
    3795
    3795
    5
    2 days 20 hrs 43 mins
    4123
    4123
    6
    4 days 21 hrs 24 mins
    7044
    7044
    7
    6 days 7 hrs 21 mins
    9081
    9081
    8
    11 days 4 hrs 26 mins
    16106
    16106
    9
    18 days 0 hrs 19 mins
    25939
    25939
    10
    19 days 3 hrs 5 mins
    27545
    27545
    11
    28 days 7 hrs 28 mins
    40768
    40768
    12
    29 days 2 hrs 28 mins
    41908
    41908
    13
    31 days 8 hrs 34 mins
    45154
    45154
    14
    53 days 12 hrs 15 mins
    77055
    77055
    Dave

+ 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] Sort Data, Sum Values, and Store the Values on A New Sheet
    By aviatecar in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-04-2014, 06:30 PM
  2. [SOLVED] Sort Data, Sum Values, And Store the Values on A New Sheet
    By aviatecar in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-22-2014, 02:17 PM
  3. Sort a column but sort VALUES only (not formatting)
    By JasperD in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-08-2014, 05:25 AM
  4. Replies: 1
    Last Post: 04-18-2014, 05:54 PM
  5. [SOLVED] Match values from two different columns and sort according to the matched values
    By kongfookann in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 12-20-2013, 09:44 AM
  6. Sort values on Col A based on values in Col B
    By holmes123 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-27-2012, 11:43 AM
  7. Generate unique values,count of values occurences then sort
    By Hudas in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-16-2012, 05:22 PM

Tags for this Thread

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