If cell A1 contains "Brother Sister Father Mother Grandson" and cell A2 contains "Mother Father", return 2 in cell A3.
How can I achieve this?
Try
=SUMPRODUCT(TRANSPOSE(SPLIT(A1," "))=SPLIT(A2," "))