It seems to me the best way is to concatenate values in a row and the apply "Remove Duplicates":
The result is demonstrated in E:G.