Home » excel » excel – Formula that will repeat number X times and increased by a counter

excel – Formula that will repeat number X times and increased by a counter

Posted by: admin May 14, 2020 Leave a comment

Questions:

I have the following problem: I need to repeat a given number, say 3 times. I then need to repeat the next number the same amount of times. So I need a formula to print, for instance, 111, 222, 333, 444 etc. each on a different row. Can this be done? Thanks.

How to&Answers:

So something like:

A1 =REPT(1,3)      // Initial number set to 1, repeated 3 times to give 111
A2 =REPT(LEFT(A1,LEN(A1)/3)+1,3)
A3 =REPT(LEFT(A2,LEN(A2)/3)+1,3)

etc

Answer:

Still not 100% sure what you’re trying to accomplish. But in the scenario where you want to see:

111,222,…,101010,111111,…,999999,100100100,101101101,…

You could just copy this formula down the column:

=REPT(ROW(),3)

ROW() returns the current row, so you might have to do a little math to make it produce your number. I.e. if you want “111” to appear in row #2, “=REPT(ROW()-1,3)”

If that’s not what you’re looking for, please be more explicit.

Answer:

Try on A1 =REPT(1+FLOOR(COLUMN()-1,3)/3,3) and then drag to all other columns… hopefully this is what you wanted if I understood correctly from the comments.