k4 (kdb+), 11 characters
26/:1+.Q.A?
Explanation:
- k4 parses left of right
.Q.A is defined within k4 - it is the vector "ABC...XYZ"
? is the find operator - the index of the first match for items in the y arg within the x arg
- +1 to offset the index
26/: to convert to base 26
One caveat - this will only work where listed types are passed in:
26/:1+.Q.A? "AD"
30
26/:1+.Q.A? "WTF"
16074
but:
26/:1+.Q.A? ,"A"
1