Convert numbers 1-26 to A-Z?
How can I convert the numbers in the range 1 through 26 to 开发者_运维技巧their respective letter position in the alphabet?
1 = A
2 = B ... 26 = ZCHR(#)
will give you the ASCII character, you just need to offset it based on the ASCII table:
e.g. A = 65, so you will need to add 64 to 1:
CHR(64 + #) = A if # is 1
ASCII code is the numerical representation of a character such as 'a' or 'Z'. Therefore by looking at the table one can see that capital A has a value of 65 and Z has a value of 90. Adding 64 from each value in the range 1-26 will give you their corresponding letter.
精彩评论