Try this.
Create a new formula field.
if right({yourfieldname},1) in ["1","2"] then left({yourfieldname},length({yourfieldname})-1) else {yourfieldname}
...which effectively says, if your field ends with a 1 or 2, then strip the last character off (regardless of character length), otherwise...