Repeat each row N times in Google Sheets

Without splitting and joining and other string manipulations,

=ARRAYFORMULA(FLATTEN(IF(SEQUENCE(ROWS(A2:A4),5),A2:A4)))
  • A2:A4 The range to repeat
  • 5 Number of times to repeat
  • SEQUENCE to create a 2D array of numbers
  • IF to transpose a 1D array A2:A4 to a 2D array of size equal to the SEQUENCE array created
  • FLATTEN 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

Leave a Comment