+ Reply to Thread
Results 1 to 7 of 7

Sorting an multilevel / hierarchical column

  1. #1
    Registered User
    Join Date
    08-22-2016
    Location
    MTL, CA
    MS-Off Ver
    2013
    Posts
    60

    Sorting an multilevel / hierarchical column

    I need to sort a multi-thousand records table and here is an extract;

    Seq
    1
    1.1
    1.111
    2
    1.1.2
    1.1.2.1

    so it will end

    Seq
    1
    1.1
    1.1.2
    1.1.2.1
    1.111
    2

    It can be up to 7 levels. What would be the best strategy? I would be fine to add 7 columns as sublevels, I just don't know how to populate them.

    TIA.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Sorting an multilevel / hierarchical column

    Hi,

    What's the maximum number of digits in any level?
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    08-22-2016
    Location
    MTL, CA
    MS-Off Ver
    2013
    Posts
    60

    Re: Sorting an multilevel / hierarchical column

    2

    I found a way to do it. It now works and I sort on columns Order1...Order11.

    I can't post the code here as I get this message (no SQL code)

    Block details:
    Your IP: 216.208.79.194
    URL: http://www.excelforum.com/newreply.p...eply&t=1367723
    Your Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36
    Block ID: SQLi84
    Block reason: SQL injection was detected and blocked.
    Time: 2022-01-06 13:43:36
    Server ID: 14015

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Sorting an multilevel / hierarchical column

    [QUOTE=Saintor;5616276]2

    But there are 3 digits in the second level of

    1.111

    so I don't understand the response of '2'

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Sorting an multilevel / hierarchical column

    Assuming header in A1 and sort from A2 onwards.
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    08-22-2016
    Location
    MTL, CA
    MS-Off Ver
    2013
    Posts
    60

    Re: Sorting an multilevel / hierarchical column

    Thanks for the code. Yes I thought that none of our drawings had more than 99 components but this was a wrong assessment.

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Sorting an multilevel / hierarchical column

    If it is not working, upload the workbook showing before/after.

+ 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] MultiLevel Sort till end column
    By wilsonwilson4 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-11-2021, 11:27 AM
  2. Replies: 3
    Last Post: 11-06-2019, 09:26 AM
  3. Hierarchical Sorting Problem
    By oglesbyr in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-19-2015, 10:57 AM
  4. Add column to give average in a hierarchical model
    By guy.zenx in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 05-17-2013, 08:02 AM
  5. MultiLevel BOM Comparison
    By gopinathtt in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 12-27-2012, 07:33 PM
  6. Multilevel Ranges
    By Cheer-Phil-ly in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-30-2005, 05:20 PM
  7. [SOLVED] Multilevel Sorting?
    By Mike in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-18-2005, 11:06 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