Hi

I have a column of 600+ values (English football positions) and would like to find and replace them based on some criteria. An example spreadsheet is attached. Example.xlsx

The column is something like:

Position
FW
FW
GK
M(C)
M(C)
D(C)
M(CLR),FW
AM(CL),FW
FW
D(R),DM(C)
M(CL)
D(CR)
DM(C),M(L)
M(CL)
....

The criteria I have is that any value with "M" (i.e. M(C), M(CL), DM(C)) should be replaced by "MF". Any value with "D" (i.e. D(R), D(C)) should be replaced with "DF".
[Note here, that DM(C) contains both "D" and "M" but "M" condition to take priority]
FW remains as FW.
GK remains as GK.
For cells with two values, both values should be replaced based on the criteria and remain separated by a comma.
E.g. D(R), DM(C) should be replaced by DF,MF
But, if the two values overlap, they should be replaced by just one.
E.g. DM(C),M(L) should be replaced by MF

This is a bit out of my league. Is there any easy way to do this?

Thank you