开发者

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 = Z


CHR(#) 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜