If you are looking to return the matching DOB's in the same cell, then you can use a UDF:
Function aconcat(a As Variant, Optional sep As String = "") As String
' Harlan Grove, Mar 2002
Dim y As Variant
If TypeOf a Is Range Then
For Each y In a.Cells
aconcat = aconcat & y.Value & sep
Next y
ElseIf IsArray(a) Then
For Each y In a
aconcat = aconcat & y & sep
Next y
Else
aconcat = aconcat & a & sep
End If
aconcat = Left(aconcat, Len(aconcat) - Len(sep))
End Function
and then apply formula in A2:
=SUBSTITUTE(TRIM(aconcat(IF(data!$A$2:$A$6=B2,data!$D$2:$D$6,"")," "))," ",",")
adjusting ranges to suit and then confirm with CTRL+SHIFT+ENTER not just ENTER and copy down.
Bookmarks