If you add this code to a VBA module in the workbook:
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
then you can use formula:
=IF(F2=1,TRIM(aconcat(IF($E$2:$E$8=E2,$G$2:$G$8,"")," ")),"")
confirmed with CTRL+SHIFT+ENTER and not just ENTER and copied down.
Bookmarks