+ Reply to Thread
Results 1 to 10 of 10

Sorting with Parent and Child

  1. #1
    Registered User
    Join Date
    06-04-2013
    Location
    Hong Kong
    MS-Off Ver
    Excel 2010
    Posts
    5

    Sorting with Parent and Child

    I would like to do the sorting with PARENT and CHILD function, can it be done without using VBA?

    The attachment is copied from a txt file and generated by system.

    The 1st level is "Share Documents"
    2nd level has a "-"
    3rd level has a "--"
    4th level has a "---"

    Is it possible to use function / formula to resolve this problem?
    I would like to sort it with 1st level then 2nd level...but 2nd level must be follow the 1st level to do sorting.
    Something like the below

    Share document
    -A
    -B
    --B1
    --B2
    --B3
    -C
    --C1
    ---C1i
    ---C2i
    --C2
    --C3
    -D
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Sorting with Parent and Child

    What determines parent?
    ie how do i know that
    --HK Office Dec Seminar
    --HK Chartered Secretaries
    --HK December Conference
    belongs under -Project Miranda and not -Project Algebra
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Sorting with Parent and Child

    Why don't you simply use Data>Sort?


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  4. #4
    Registered User
    Join Date
    06-04-2013
    Location
    Hong Kong
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Sorting with Parent and Child

    Hi Humdingaling,
    Thanks for your quick reply,

    --HK Office Dec Seminar
    --HK Chartered Secretaries
    --HK December Conference
    the mother object is -Hong Kong Ordinance


    Also, in the attachment,

    Row 21 is the child of Row 20.
    Row 25 is the child of Row 24.
    Row 33 to Row 46 is the child of Row 32.

  5. #5
    Registered User
    Join Date
    06-04-2013
    Location
    Hong Kong
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Sorting with Parent and Child

    hi Sixthsense,

    Thanks, if I just you data>sort, the child will be sorted and will not follow the PARENT object. All text field with "-" will be on top , and "--" will be at the bottom.., I need the "--" follow the PARENT.

  6. #6
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Sorting with Parent and Child

    Column
    E and F are the formula's

    B is your original order
    C is your sorted list parent
    A is proper list

    Sorting by C then B gives you this result
    otherwise your parent will not be on top
    Attached Files Attached Files
    Last edited by humdingaling; 06-04-2013 at 04:43 AM. Reason: additional info added

  7. #7
    Registered User
    Join Date
    10-13-2012
    Location
    Georgia
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Sorting with Parent and Child

    Book1.xls

    column A is your result list. in column B i removed "-" because some words contain this symbol. other column are formulas.

  8. #8
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Sorting with Parent and Child

    May be this in B2 Cell?

    In B2 Cell
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Drag it down.. and copy the Column-B formula cells and paste it as values.

    Now apply sorting by selecting Column-B as first criteria and Colum-A as second criteria.

  9. #9
    Registered User
    Join Date
    06-04-2013
    Location
    Hong Kong
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Sorting with Parent and Child

    Thanks, the problem is solved, thanks sixthsense!!

  10. #10
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Sorting with Parent and Child

    Glad it helps you and thanks for the feedback

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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