+ Reply to Thread
Results 1 to 8 of 8

Sort by 3rd,4th,5th numbers

Hybrid View

  1. #1
    Registered User
    Join Date
    03-31-2021
    Location
    Trieste
    MS-Off Ver
    Win 10
    Posts
    3

    Sort by 3rd,4th,5th numbers

    Yet another newbie's question: I can't figure out how to sort given code (example in attachment) by 3rd,4th,5th numbers.
    Thanks for help.
    (I don't know if "minus" is necessary, it was useful to explain the task.)
    Attached Files Attached Files
    Last edited by GiorgioGJ; 03-31-2021 at 05:06 AM.

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,798

    Re: Sort by 3rd,4th,5th numbers

    Extract 3/5 digits into a "helper" column ans sort on this column

    e.g = MID(A3,3,3)*1
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    03-31-2021
    Location
    Trieste
    MS-Off Ver
    Win 10
    Posts
    3

    Re: Sort by 3rd,4th,5th numbers

    Thank you very much. What about if I'd need the minus separator to be inserted and keep text formatting? Sorry for abusing your kindness.... I'm learning Excel from scratch...

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,798

    Re: Sort by 3rd,4th,5th numbers

    Change the MID to reflect the situation with your "-" signs

    e.g using Column D

    =MID(D3,4,3)*1

    starting at 4th character in the text field

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,798

    Re: Sort by 3rd,4th,5th numbers

    @Glenn,
    Time for coffee I think: remember KISS ?

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Sort by 3rd,4th,5th numbers

    This array formula works on my version of Excel... It may/may not work on yours... but whatever... I'd go with John's solution...


    =LEFT(INDEX($A$3:$A$13,MATCH(SMALL(MID($A$3:$A$13,3,3)+0,ROW($A$3:$A$13)-ROW($A$3)+1),MID($A$3:$A$13,3,3)+0,0)),2)&TEXT(SMALL(MID($A$3:$A$13,3,3)+0,ROW($A$3:$A$13)-ROW($A$3)+1),"000")&MID(INDEX($A$3:$A$13,MATCH(SMALL(MID($A$3:$A$13,3,3)+0,ROW($A$3:$A$13)-ROW($A$3)+1),MID($A$3:$A$13,3,3)+0,0)),6,255)+0
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  7. #7
    Registered User
    Join Date
    03-31-2021
    Location
    Trieste
    MS-Off Ver
    Win 10
    Posts
    3

    Re: Sort by 3rd,4th,5th numbers

    Great help. Congratulations. Wish you a wonderful day (Free).

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,798

    Re: Sort by 3rd,4th,5th numbers

    You're welcome.

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

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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: 4
    Last Post: 10-20-2020, 04:15 PM
  2. [SOLVED] Sort numbers and numbers stored as text separately?
    By Mirisage in forum Excel General
    Replies: 2
    Last Post: 02-05-2019, 11:28 AM
  3. Replies: 5
    Last Post: 11-20-2016, 10:02 PM
  4. [SOLVED] How do you sort item numbers targeting only specific numbers?
    By matt323 in forum Excel General
    Replies: 10
    Last Post: 12-29-2013, 01:15 AM
  5. Replies: 1
    Last Post: 12-28-2013, 11:46 PM
  6. [SOLVED] sort using vba want to sort text-as-numbers
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-26-2013, 11:46 AM
  7. [SOLVED] How to merge a numbers from 3 cells, eliminate repetitive numbers, and sort such numbers?
    By david gonzalez in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-22-2012, 11:59 AM

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