Good Sunday Evening everyone 
After I got so excellent and quick help solving my previous problem, I am hoping now that you may help me with a related, new difficulty:
I have:
column A: international individual identifier of animal (a number)
column B: national individual identifier of animal (also a number)
column C: international individual identifier of father of animal in A (number)
column D: national individual identifier of father of animal in A (number)
column E: desired output = all children of animal in A listed as a string
In column E I want to use the code posted in response to my previous question with the formula given. It worked great to list all children of the respective animal in the current row.
The problem now is that for some animals and for some fathers international identifiers are not available. I have alternative identifiers for those though. Therefore, I would like to introduce a second Variable as alternative search term (current cell in D), plus an alternative range to evaluate (column B) and an alternative range to get the results from (column B). Only if the respective international identifier is lacking and the cell in A or C is empty, I would like the program to use the alternative national identifiers instead (eg. if "xCriteria" is nothing then use "altxCriteria", if "compareRange" is nothing then use "altcompareRange", if "stringsRange" is nothing then use "altstringsRange").
I have played around with the code a little, but I didn't figure it out yet. Particularly, I don't know where I should put the line that goes:
If xCriteria is Nothing Then Set xCriteria = altxCriteria
If anyone can teach me how to solve my problem, I would greatly appreciate.
Thank you in advance,
have a nice sunday, 
N
Bookmarks