View Full Version : Create a loop with characters.


ornatum
04-09-2011, 06:57 AM
Hello all,
Can anyone help me with the following?

Assume I have in cell A1 the character "1", in cell A2 the character "2", etc up to A9 with the character "9".
Now in cell B1 is the character "A", in cell B2 the character "B", ...., cell B26 the character "Z"

The question:
Is there any way to write a function/formula or any other way so that in cells C1/C2/C3/C4.....etc, I will get the "result" of connecting characters from cells A, and B.
Example:
Cell C1 to have 1A,
Cell C2 to have 1B,
......
......
Cell C26 to have 1Z,

Cell C27 to have 2A,
Cell C28 to have 2B,
......
......
Cell C52 to have 2Z, etc, etc
Please help!!!!!!!!!!

NBVC
04-11-2011, 09:20 AM
In C1 enter:

=INDEX($A$1:$A$9,MOD(INT((ROWS($A$1:$A1)-ROW($A$1))/COUNTA($B$1:$B$26)),COUNTA($B$1:$B$26))+1)&INDEX($B$1:$B$26,MOD(ROWS($A$1:$A1)-1,26)+1)

copied down as far as necessary

ornatum
04-11-2011, 10:00 AM
Thank you NBVC for your answer, BUT, does not work. Somewhere in the code must be an error.

NBVC
04-11-2011, 11:16 AM
See attached. Is that not what you wanted?

Perhaps your version of Excel needs you to replace the comma separators with semi-colons as below

=INDEX($A$1:$A$9;MOD(INT((ROWS($A$1:$A1)-ROW($A$1))/COUNTA($B$1:$B$26));COUNTA($B$1:$B$26))+1)&INDEX($B$1:$B$26;MOD(ROWS($A$1:$A1)-1;26)+1)

boblarson
04-11-2011, 01:32 PM
The original worked for me. :)

ornatum
04-16-2011, 09:15 AM
Thank you again NBVC.

Is working perfect. Thats what I wanted!!!!!!!!!!

Great!!!!!!!!!!!!!!!!

NBVC
04-25-2011, 04:37 AM
I don't understand the question.

DCrake
04-25-2011, 04:44 AM
NVBC:
Ignore previous poster wasa spammer who has now been banned. He was just trying to buildup his post count before posting url's