Reputation: 13
I have managed to make this formula:
=IF(COUNTIF($A$1:A1,A1)=$B$1,A1+1,A1)
Is making an incremental list in the same column, starting with 01, and on cell B1 I am instructing how many times this number should repeat (up to 5 times per number). So, if I say repeat 2 times it looks like this:
Column A |
---|
1 |
1 |
2 |
2 |
How can I make it an Array Formula? I'm barely starting on Arrays so I'm just trying to learn as I go.
Upvotes: 1
Views: 861
Reputation: 36975
Try Sequence()
with ROUNDUP()
function.
=ArrayFormula(ROUNDUP(SEQUENCE(B1*B1)/B1,0))
When enter 3:
Upvotes: 1
Reputation: 15328
Try this
=ARRAY_CONSTRAIN(arrayformula(query(flatten(split(rept("|"&A2:A,B2:B),"|")),"select * where Col1 is not null")),SUM(B2:B),1)
https://docs.google.com/spreadsheets/d/1qXy-hzWUnsUmAa-8aV5IHOyZABGD_h8ajICLwdyNge8/edit?usp=sharing
Upvotes: 1
Reputation: 1131
you can try to solve this with the following formula =ArrayFormula(flatten(if(SEQUENCE(1,C1),SEQUENCE(C2))))
but you should specify the value limit in cell C2
to which the numbers must increase, otherwise the formula will loop
Upvotes: 1