Hi excel experts

my data in two columns the first column is column A has data separated by spaces
e.g
cat dog fish camel

in column B there are data (you may call it Brands)
In the worksheet there are a lot of similar brands (e.g ALK)

I wanted to collect each brand in just one row instead of several rows

cat dog fish camel **** ALK
he she it we you ****** ALK
go went gone sell ***** MLK

The result wanted collect ALK in one row
cat dog fish camel he she it we you *** ALK
go went gone sell *** MLK