+ Reply to Thread
Results 1 to 14 of 14

Creating a hierarchy structure with formulas

  1. #1
    Registered User
    Join Date
    10-01-2021
    Location
    NYC
    MS-Off Ver
    365
    Posts
    39

    Creating a hierarchy structure with formulas

    Greetings

    I have a sample file where I would like to use formulas to break/split column A into multiple columns that follows a hierarchy structure. I did use the search but most results were coming up in VBA and macros. My original file (not the sample provided) is 2000+rows and was originally a CSV file.

    Thank you for any insight into this.
    Attached Files Attached Files

  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,915

    Re: Creating a hierarchy structure with formulas

    Are the 2000+ rows a EXACT repetition of your file i.e range of A1:B27 ? If not, please post file showing more than one "period".
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Registered User
    Join Date
    10-01-2021
    Location
    NYC
    MS-Off Ver
    365
    Posts
    39

    Re: Creating a hierarchy structure with formulas

    Hi John,

    Thanks for replying. For this file, they are an exact repetition. Although I will be working with other files where the year might change. How would you handle the exact repetition and how would it be different if there were different periods?

  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,915

    Re: Creating a hierarchy structure with formulas

    Exact repetition offers the chance to use "row" calculations to index to the data. If the data is "irregular" then it is more difficult to determine the start of a given period.

    I recommend you post a sample of both: in theory the "irregular" solution will work for the "regular" but not vice-versa.

  5. #5
    Registered User
    Join Date
    10-01-2021
    Location
    NYC
    MS-Off Ver
    365
    Posts
    39

    Re: Creating a hierarchy structure with formulas

    I understand and thanks again. I have an example of a different hierarchy that is not a repetition in the columns and it is completely different from the first file.

    *removed file
    Last edited by Statzz; 10-29-2021 at 08:34 AM.

  6. #6
    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,915

    Re: Creating a hierarchy structure with formulas

    Given your latest file and its complexity, my choice would be a VBA solution. I don't have 365 so I cannot comment on whether a formulaic solution is more viable with 365.

    A result page on your latest file will help.

  7. #7
    Registered User
    Join Date
    10-01-2021
    Location
    NYC
    MS-Off Ver
    365
    Posts
    39

    Re: Creating a hierarchy structure with formulas

    I cannot use VBA. Could you provide a solution for my first example, the repetition hierarchy? This would be a lot of help.

  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,915

    Re: Creating a hierarchy structure with formulas

    I haven't worked out a "flexible" hierarchy which needs to based on "parent/child" relationships. I'll try and look at this over the weekend but cannot promise a solution.

    Hopefully others will pick up the challenge!

  9. #9
    Registered User
    Join Date
    10-01-2021
    Location
    NYC
    MS-Off Ver
    365
    Posts
    39

    Re: Creating a hierarchy structure with formulas

    I appreciate the replies and hopefully someone else can jump in. To get the ball rolling though, what formulas could I use? I am just trying to approach the problem and I am coming up blank on where to even start.

    Have a great weekend John!

    Edit: Could I use something like IF column A has a dash move cell to new column B, else move other cells to column C?
    Last edited by Statzz; 10-29-2021 at 10:00 AM.

  10. #10
    Valued Forum Contributor
    Join Date
    06-23-2021
    Location
    Romania
    MS-Off Ver
    2021, 365 v 2208
    Posts
    722

    Re: Creating a hierarchy structure with formulas

    The only ideea that I have is to use PowerQuery:
    HTML Code: 
    Attached Files Attached Files
    Diana Tanase


    If the solutions offered helped you to solve your problem, then mark the thread as SOLVED (thread tools in the top menu) and you can click on * to add reputation to those who helped you, as a way to say thank you !

  11. #11
    Registered User
    Join Date
    10-01-2021
    Location
    NYC
    MS-Off Ver
    365
    Posts
    39

    Re: Creating a hierarchy structure with formulas

    Thank you tanasedn! This was really helpful. Very advanced for me because I am a beginner excel user.

    I did ask my instructor for clarification and she said it could be done using IFs statements and thinking about the parent-child problem in generation terms.

  12. #12
    Registered User
    Join Date
    10-01-2021
    Location
    NYC
    MS-Off Ver
    365
    Posts
    39

    Re: Creating a hierarchy structure with formulas

    Okay, so using my instructors clarification, I came up with some formula rules for the sample book in post 1. Sorry I cannot link them because it is a URL and my account is new. Please go to post 1 for file

    rules.JPG

    So using my rules, is there a way to move the words in column A to new columns based on the conditions I provided?

  13. #13
    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,915

    Re: Creating a hierarchy structure with formulas

    See "before" in attached using solution offered by your instructor!:
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    10-01-2021
    Location
    NYC
    MS-Off Ver
    365
    Posts
    39

    Re: Creating a hierarchy structure with formulas

    Thank you John for not giving up! You solved the problem in post 1 and I believe this is the starting point for me to go on for the more complex sheets. I appreciate the help and I feel so much better!

+ 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. Creating a hierarchy structure
    By nav112 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-24-2021, 11:34 AM
  2. Creating multiple drop box in hierarchy
    By unley in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-05-2016, 04:41 AM
  3. Creating Org Hierarchy using a Macro
    By adviat in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-21-2015, 04:34 AM
  4. Sort grouped data while preserving structure / hierarchy
    By Buzzed Aldrin in forum Excel General
    Replies: 5
    Last Post: 01-09-2015, 09:19 PM
  5. Creating a Pyramid Hierarchy structure from a flat structure
    By thegamerulez in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-16-2014, 01:28 AM
  6. creating a hierarchy from equipment list
    By mrggutz in forum Excel General
    Replies: 2
    Last Post: 02-14-2011, 07:26 PM
  7. present data as hierarchy/tree structure in user form
    By Malin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-15-2005, 04:42 AM

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