I have a population of animals. I want to calculate the age the mother of each individual had when that individual was born.
In my spreadsheet with data, I have (among other things I want to test) the ID of each individual, the date of birth of that individual and its mother ID. Note that the Mother IDs are the same value as some individual IDs because, in my population, some individuals are both a mother and offspring (multigenerational).
The spreadsheet looks like in the image. Note that the examples I have posted some the mother/dams are wild animals and their ID's are unknown.
My challenge is how do I will enter the date of birth of each mother in the row of each individual. I have 1700 individuals and computing this by hand seems crazy. Is it possible to ask Excel to retrieve the DoB of the dam? I have been trying some formulas but so far without success. I also tried to create another sheet with only the IDs and dates of birth and asking excel to retrieve the date of birth (from that other sheet) if in the column "Dam" is a specific number (ID).
So ideally I want to link the following data:
Individual ID ---- DoB ---- Dam ---- Dam's DoB
Ideally I also would like to have a suggestion on how can I input the birth rank of each individual (1st child, 2nd child...) and the interval between births of the same female (in years) in a automated way.
This formula will give the Dam ID if put in row 2 to start with: