Results 1 to 7 of 7

Sorting of rows belonging to one of four hierarchical levels

Threaded View

  1. #1
    Forum Contributor
    Join Date
    08-20-2011
    Location
    Oslo
    MS-Off Ver
    MS 365
    Posts
    245

    Sorting of rows belonging to one of four hierarchical levels

    Hi,

    I have exported data from a maintenance database, where each row belongs to one of four levels in a hierarchy. Imagine a machine being the top level, and then you drill down through the hierarchy to main parts, their subparts until you reach the smallest bits.

    Each row has a unique asset number for the specific (sub-)part, accompanied by a "parent asset" to which it belongs. The parent asset is the immediate level above, if any.

    I have attached a workbook with an example, where I have added an extra column A, where I have manually indicated which level each row represents.

    Only one row has the top level 1, while in this example there are two rows that have the next level 2, etc. The parent asset cell is blank for the top level 1, since it hasn't got any parent level above it.

    My problem is that the exported rows don't come sorted in a meaningful way, and they can't be sorted the way I want by using the regular sort function in Excel.

    I am therefore looking for a way to create helper columns that I can use for sorting purposes.

    I want to sort the rows this way:

    Level 1 followed by the alphabetically next level 2 row, followed by this level 2 row's alphabetically next level 3 row, followed by this level 3 row's alphabetically next level 4 row(s) - insofar that each level contain rows to sort.


    Level 1
    Level 2.1 belonging to level 1
    Level 3.1 belonging to level 2.1
    Level 4.1 belonging to level 3.1
    Level 4.2 belonging to level 3.1
    Level 4.3 belonging to level 3.1
    Level 3.2 belonging to level 2.1
    Level 4.1 belonging to level 3.2
    Level 2.2 belonging to level 1
    Level 3.1 belonging to level 2.2
    Etc.

    Does anybody have a solution for this?

    Regards,
    Marbleking
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Sorting an multilevel / hierarchical column
    By Saintor in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-07-2022, 09:35 AM
  2. Dissolve hierarchical structure into multiple rows
    By snelstim in forum Excel General
    Replies: 0
    Last Post: 05-17-2021, 05:31 AM
  3. [SOLVED] Sorting will not hold the the information belonging to the row.
    By The Force in forum Excel General
    Replies: 19
    Last Post: 08-31-2020, 10:41 PM
  4. Replies: 3
    Last Post: 11-06-2019, 09:26 AM
  5. Hierarchical Sorting Problem
    By oglesbyr in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-19-2015, 10:57 AM
  6. How do I group rows hierarchical (1, 1.1, 1.1.2 ...)
    By jugeh in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-09-2013, 05:19 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