SOLVED

New Contributor

# Alphabet Wrap

Input is any letter in the alphabet.

If input is 'B', then output is B + x

If output exceeds Z, I'd like it to wrap back around to the beginning of the alphabet instead of something like BC or AD

So input is Y and x = 4 then output should be C

Thanks

5 Replies

# Re: Alphabet Wrap

@MajorHavoc Perhaps like this (with input in B1 and x in B2)?

``=CHAR(IF((CODE(B1)+B2)>90,CODE(B1)+B2-26,CODE(B1)+B2))``

This assumes that you only enter capitals, by the way.

# Re: Alphabet Wrap

Try this, where A1=Y and B1=4

=CHAR(MOD(CODE(UPPER(A1))+B1-64,26)+64)

# Re: Alphabet Wrap

Yes that works well with upper case but if lower case is entered it advances 10 places and outputs " j " .

Very confusing.

# Re: Alphabet Wrap

This only works for upper case.

But it's a start.

best response confirmed by MajorHavoc (New Contributor)
Solution

# Re: Alphabet Wrap

Okay, give this a try:

=IF(EXACT(A1,UPPER(A1)),CHAR(MOD(CODE(A1)+B1-65,26)+65),CHAR(MOD(CODE(A1)+B1-97,26)+97))