Easist thing to do would be to add a hidden column with a big IF statement.
=if(c5="A",4,if(c5="B",3,if(c5="C",2,if(c5="D",1,"error"))))
I don't know if I closed those parentheses properly, and I don't particularly care
. There's more elegant methods, but this would be the quick'n'dirty method.