Help with reference formulas for a family tree builder.

%3CLINGO-SUB%20id%3D%22lingo-sub-1964638%22%20slang%3D%22en-US%22%3EHelp%20with%20reference%20formulas%20for%20a%20family%20tree%20builder.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1964638%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20All!%3C%2FP%3E%3CP%3EI'm%20trying%20to%20make%20a%20family%20tree%20builder%20in%20excel%20which%20will%20eventually%20turn%20into%20a%20many%20tabbed%20family%20report%20based%20on%20CSV%20data%20converted%20from%20a%20Gedcom%20(genealogy%20software%20file).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20attached%20a%20mock%20file.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EEach%20person%20in%20the%20tree%20is%20referred%20to%20by%20a%20SOSA%20%23%20(an%20individual's%20fathers%20number%20is%20their%20number%20x2%2C%20the%20mothers%20number%20is%20x2%2B1%20and%20so%20that%20continues%20up%20the%20tree%2C%20with%20the%20home%20individual%20being%20%231).%20I'd%20like%20to%20use%20the%20SOSA%20number%20in%20my%20table%20to%20refer%20each%20vital%20fact%20to%20the%20tree.%20I've%20tried%20using%20HLOOKUP%20to%20refer%20the%20data%2C%20but%20after%20about%2020%20different%20variations%20I%20can't%20seem%20to%20find%20the%20right%20combo.%20If%20it%20doesn't%20give%20me%20an%20error%2C%20it%20comes%20back%20a%20strange%20number!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ELikewise%2C%20Id%20like%20to%20find%20one%20reference%20formula%20(USING%20the%20Sosa%20formula%20from%20the%20previous%20individual)%20to%20just%20exponentially%20create%20the%20reference%20so%20I%20don't%20have%20to%20type%26nbsp%3B%20%3DSOSA%20242%2C%26nbsp%3B%20%3DSOSA%20484%20and%20onward.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20Excel%20super-geniuses%20willing%20to%20feed%20me%20formula's%3F%20I%20may%20be%20asking%20too%20much%2C%20but%20any%20help%20or%20suggestions%20would%20help%20me%20work%20it%20out.%20Frankly%20I%20can't%20believe%20someone%20hasn't%20published%20a%20more%20comprehensive%20template%20to%20work%20this%20out.%20Everything%20seems%20to%20be%20manual%20and%20thats%20quite%20a%20bit%20of%20data%20entry.%3C%2FP%3E%3CP%3EThank%20you%20in%20advance!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1964638%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1964971%22%20slang%3D%22en-US%22%3ERe%3A%20Help%20with%20reference%20formulas%20for%20a%20family%20tree%20builder.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1964971%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F894015%22%20target%3D%22_blank%22%3E%40MelanieBeth%3C%2FA%3E%26nbsp%3BI'm%20a%20bit%20confused%20at%20what%20exactly%20you%20want.%26nbsp%3B%20I%20created%20the%20following%20formula%20based%20on%20the%20general%20format%20you%20have%20for%20your%20tree.%26nbsp%3B%20It%20assumes%20you%20start%20in%20the%202nd%20column%20with%20the%201st%20gen%20and%20the%20data%20is%20in%20the%203rd%20column%20and%20each%20generation%20after%20is%20in%20the%20following%20pair%20of%20columns.%26nbsp%3B%20So%20all%20you%20need%20to%20do%20is%20set%201%20cell%20to%20the%20SOSA%23%20you%20want%20to%20start%20with%20and%20it%20will%20generate%20all%20the%20others.%26nbsp%3B%20You%20can%20add%20additional%20generations%20if%20you%20want%20also%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DTRANSPOSE(XLOOKUP(%24C%2414*2%5E((COLUMN()-3)%2F2)%2BCOUNTIF(B%241%3AB15%2C%22%3DBirth%22)%2Cgedcomdata!%24A%3A%24A%2Cgedcomdata!%24E%3A%24G%2C%22N%2FA%22%2C0))%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3ESee%20attached%20for%20how%20it%20works.%3C%2FP%3E%3CP%3EIf%20you%20don't%20have%20array%20formulas%20you%20might%20need%20to%20enter%20CTRL-SHIFT-ENTER%20or%20break%20it%20into%203%20formulas%20for%20Name%2C%20Birth%2C%20and%20Death%20instead%20of%20the%20single%20array%20I%20created%20here%20(basically%20instead%20of%20%24E%3A%24G%20you%20need%20to%20use%20%24E%3A%24E%20then%20%24F%3A%24F%20and%20then%20%24G%3A%24G).%26nbsp%3B%20If%20you%20don't%20have%20XLOOKUP()%20it%20can%20be%20recreated%20using%20INDEX()-MATCH().%3C%2FP%3E%3CP%3EI%20hope%20this%20works%2C%20but%20if%20it%20isn't%20what%20you%20wanted%20please%20explain%20what%20you%20need%20a%20little%20more.%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hi All!

I'm trying to make a family tree builder in excel which will eventually turn into a many tabbed family report based on CSV data converted from a Gedcom (genealogy software file).

 

I have attached a mock file.

 

Each person in the tree is referred to by a SOSA # (an individual's fathers number is their number x2, the mothers number is x2+1 and so that continues up the tree, with the home individual being #1). I'd like to use the SOSA number in my table to refer each vital fact to the tree. I've tried using HLOOKUP to refer the data, but after about 20 different variations I can't seem to find the right combo. If it doesn't give me an error, it comes back a strange number!

 

Likewise, Id like to find one reference formula (USING the Sosa formula from the previous individual) to just exponentially create the reference so I don't have to type  =SOSA 242,  =SOSA 484 and onward. 

 

Any Excel super-geniuses willing to feed me formula's? I may be asking too much, but any help or suggestions would help me work it out. Frankly I can't believe someone hasn't published a more comprehensive template to work this out. Everything seems to be manual and thats quite a bit of data entry.

Thank you in advance!

3 Replies

@MelanieBeth I'm a bit confused at what exactly you want.  I created the following formula based on the general format you have for your tree.  It assumes you start in the 2nd column with the 1st gen and the data is in the 3rd column and each generation after is in the following pair of columns.  So all you need to do is set 1 cell to the SOSA# you want to start with and it will generate all the others.  You can add additional generations if you want also:

=TRANSPOSE(XLOOKUP($C$14*2^((COLUMN()-3)/2)+COUNTIF(B$1:B15,"=Birth"),gedcomdata!$A:$A,gedcomdata!$E:$G,"N/A",0))

See attached for how it works.

If you don't have array formulas you might need to enter CTRL-SHIFT-ENTER or break it into 3 formulas for Name, Birth, and Death instead of the single array I created here (basically instead of $E:$G you need to use $E:$E then $F:$F and then $G:$G).  If you don't have XLOOKUP() it can be recreated using INDEX()-MATCH().

I hope this works, but if it isn't what you wanted please explain what you need a little more.

@mtarler 

This is great! Its exactly what I wanted!!! I knew there had to be functions to carry the data over and autogenerate. Ill, admit the formula is a bit (read: entirely) over my head, but now I know what elements to study. 

I'm sure it does work, but there so much in the formula that I don't understand. Would you mind breaking the formula down to one bit of info without the array, (ex Birth) and without the generational building? Just so I can dissect it?

 Thank you again!

@MelanieBeth  Sure, no problem.  Here is the formula:

=TRANSPOSE(XLOOKUP($C$14*2^((COLUMN()-3)/2)+COUNTIF(B$1:B15,"=Birth"),gedcomdata!$A:$A,gedcomdata!$E:$G,"N/A",0))

TRANSPOSE just converts it to a vertical array instead of horizontal

XLOOKUP finds the information based on:

    Lookup_Value =  $C$14*2^((COLUMN()-3)/2)+COUNTIF(B$1:B15,"=Birth")

               this calculation is based on the COLUMN() of "this" cell the formula is in and based on the layout you are using, by subtracting 3 and dividing by 2 it gives the power to which 2 needs to be raised for that generation and multiplies that by the initial Key Value (located at $C$14).

               then I add the count of values being done above by counting how many times you have the Label "Birth" in the rows starting at B$1 up until this row (B15 in this example) to increment within that generation.

    Lookup_Array = gedcomdata!$A:$A

                simply the column to search

    Lookup_Return = gedcomdata!$E:$G

                 returns the values from column E through G of the row corresponding to where the lookup was found.  So to make this NOT an array you just need to use $E:$E for NAME, $F:$F for BIRTH, or $G:$G for DEATH (and you don't need the TRANSPOSE since it is only 1 value)

     If_not_found = "N/A" = is just what it will show if the lookup value can't be found

     Search_type = 0 = just says to only find exact matches

 

So here is an example of the NAME without it being the Array:

 

=XLOOKUP($C$14*2^((COLUMN()-3)/2)+COUNTIF(B$1:B15,"=Birth"),gedcomdata!$A:$A,gedcomdata!$E:$E,"N/A",0)

 

as you can see it doesn't change much which is part of why making it an array is so nice.

 

I hope that helps you understand the formula better.  Again, this is based on you specific layout and may need to be changed if you change your layout (e.g. if you insert additional columns between generations).  A more flexible layout/formula would be to include an "index" for each 'block' in a cell next to or above that 'block' so instead of that complicated formula I put together you just multiply by that 'index' value.  So parents would be index values of 2 and 3, next gen has 4, 5, 6, 7 and so on.  But since your 4th gen or didn't have any spaces I would have had to change your layout to do that.  Alternatively, you could just put a "parental generation" value at the top of the column and use that partially simplify the formula.  e.g. P-Gen 1, P-Gen 2 and then just use 2^P-Gen+count("BIRTH")

For your enjoyment I made this tweak in the attached file and here is the new slightly simpler equation:

=TRANSPOSE(XLOOKUP($C$14*2^C$1+COUNTIF(B$1:B15,"=Birth"),gedcomdata!$A:$A,gedcomdata!$E:$G,"N/A",0))