Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42220

Parent child relationship(excel) capture the parent tree structures

$
0
0
What is the correct formula to always capture the parent item which is dictated by the level in column B?

Currently using this excel formula but doesn't work when there is more than 1 level 5 item for each level 4 parent item. The formula is pasted in the parent column.

=IF(B29=4,"",IF(B29=5,C28)).

Basically it works up until the last two values. The last 2 values GD00459192, GD00471958 should be GD00471889 because that is the level 4 parent just like a normal levelled tree structure of parent child relationship.


As aside this spreadsheet can be 1 big 'levelled' tree structure with multiple levels the task is to identify the ' parent item each time.

Does anyone know the whole formula for multiple levels?


Imagine a list of parts to make/manufacture a car and you want to know where each item is used i.e what the parent item is. This is what I am trying to achieve.


Thanks folks

HTML Code:

Level        Item                                                      Parent
4                            GD00471699       
5                                GD00471700                            GD00471699
4                            GD00388967       
5                                GD400282-0040-00                            GD00388967
4                            GD00151963       
4                            GD00405428       
4                            GD00151962       
4                            GD00471697       
5                                GD00471698                            GD00471697
4                            GD00388967       
5                                GD400282-0040-00                            GD00388967
4                            GD00151963       
4                            GD00306675       
4                            GD00151965       
4                            GD00151971       
4                            GD00151970       
4                            GD00306674       
4                            GD00471889       
5                                GD00459192                            GD00471889
5                                GD00471888                                GD00459192
5                                GD00471958                                GD00471888


Viewing all articles
Browse latest Browse all 42220

Trending Articles