How to update the column when its the value of the another column is same?

Say Example
This is the input file →


Is there any possibility to do this.If someone have sample workouts please send it.

If anybody knows the answer please tell me

Please find the workflow.
depend on the condition on x (column B)i have sorted the column A and pasted in sheet2. (10.7 KB)

i need to paste the value by comma(,) separate in single row

from this example u hard coded the company value if its value changes dynamically how to do this

can anyone tell me the answer