Reposition Cells in a Column based on another

Looking for a way to reposition cells in one column based on another. A screenshot of the requirement is attached for reference.
Regards