Assuming achieved grade is in column A, and target grade is in column B, then you can have this in C1:

=CODE(SUBSTITUTE(B1,"A*","@"))-CODE(SUBSTITUTE(A1,"A*","@"))

Hope this helps.

Pete