How can I increment a repeating number until 195 on Google Sheets?

Viewed 48

How can I have it increment a number that repeats 12 times, so that it looks like this:

1

1

1

1

1

1

1

1

1

1

1

1

2

2

2

2

2

2

2

2

2

2

2

I've been trying to tweak this formula, but with no success: =ARRAYFORMULA(TRANSPOSE(SPLIT(QUERY(REPT(1&",",12), , 999^99), ",")))

Thanks.

4 Answers

try:

=INDEX(FLATTEN(TEXT(SEQUENCE(12), SEQUENCE(1, 12,,))))

enter image description here

Try

=arrayformula(INT(sequence(12*195,1,0,1)/12)+1)

sequence

Try-

=ARRAYFORMULA(ROUNDUP(SEQUENCE(195)/12,0))

Try this if you would like to tweak your original formula:

=ARRAYFORMULA(TRANSPOSE(SPLIT(QUERY(REPT(sequence(12)&",",12), , 999^99), ",")))
Related