goonerboi
goonerboi

Reputation: 319

Formula for finding parent child relation in Excel

I have the data in the following format in excel for which the parent is given and below the parent given is its respective child.

Parent   abc
1        def
1        fsdfd
1        sfd
1        sdf
2        fdsf
Parent   xyz
1        gsd
1        gfh
1        hgf
2        kkn

I want the formula in excel for getting the data in parent child format like below such that the parent comes instead of the numbers

abc abc
abc def
abc fsdfd
abc sfd
abc sdf
abc fdsf
xyz xyz
xyz gsd
xyz gfh
xyz hgf
xyz kkn

Upvotes: 0

Views: 1835

Answers (1)

pondersome
pondersome

Reputation: 183

Your data would have to start at Row 2 for this to work. Based on your example provided, copy this formula into col C. Once you have the "Parent" values, you can paste those values into Col A.

=IF(NOT(ISNUMBER(A2)),B2,C1)

Upvotes: 2

Related Questions