A client had a list of letter grades for students, A to Z, that he needed to chart. Since you can only chart numbers, he needed to convert them to numbers. The simplest solution was to use the CODE(cell) function to return the ASCII code for the letter, then subtract 64 from it. Since A = 65, B =66, etc., this resulted in a number between 1 and 26.
If the letter was in B3, the formula =CODE(B3)-64 returned the value that he needed. A returned 1, B returned 2, M returned 13, T returned 20, and Z returned 26.
Fortunately, he was good about using all capital letters so we didn’t have to worry about “a”, “b”, etc. This could have been solved as well by using the UPPER function which converts a letter into its uppercase equivalent (a = A, etc.)
=CODE(UPPER(B3))-64 converted the letter into an uppercase value. A letter in uppercase stayed the same, while an “a” turned into “A” before being converted into a number.