I want to convert the name to value, like this

A=1, B=2, C=3 E=4 ......(A-Z)
ABC=6

please help me. I searched the solution more than one year but it is futile.