Without splitting and joining and other string manipulations,
=ARRAYFORMULA(FLATTEN(IF(SEQUENCE(ROWS(A2:A4),5),A2:A4)))
A2:A4
The range to repeat5
Number of times to repeatSEQUENCE
to create a 2D array of numbersIF
to transpose a 1D arrayA2:A4
to a 2D array of size equal to theSEQUENCE
array createdFLATTEN
the 2D to 1D array.
A1 | Name |
---|---|
A2 | Dog |
A3 | Cat |
A4 | Ball |
Output |
---|
Dog |
Dog |
Dog |
Dog |
Dog |
Cat |
Cat |
Cat |
Cat |
Cat |
Ball |
Ball |
Ball |
Ball |
Ball |