• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Convert list to tree structure (hierarchical data)

regresss

New Member
Hi,

I have 2 column table (name, subname). I would like to look up whether each subname for a given name is also used as a name and has a subname. If yes, add this subname behind original subname and repeat for the new subname unless no subname is left, then next row.

573258d1526047853-convert-list-to-tree-gaofqod.jpg


Any idea?

I can calculate the number of rows needed for level 1 by countif(submember,list of submembers) but what about deeper levels? Macro would contain many nested conditions I suppose...
 
Thanks. It is helpful.

Isn't there any add in though? The macro from example works only for depth = 8 and is fairly long. My depth can be unknown.
 

Attachments

  • test_hierarchy.xlsx
    10.3 KB · Views: 24
Back
Top