Forum Discussion

leolapa's avatar
leolapa
Brass Contributor
Jan 08, 2025
Solved

Create array with repeated values from another array

The screenshot below pretty much summarizes what I need to accomplish.

Say I have the "Original array" below.

I need to come up with a formula that will create another array (the "Resulting array" below) by repeating each value from the "Original array" on this case 3 times.

How can I do it?

 

  • There are a number of ways.  Here is one using 365:

    =CHOOSEROWS(Table1,INT(SEQUENCE(ROWS(Table1)*count,,1,1/count)))

     

4 Replies

  • In A9:

    =LET(array, A2:B4, repeat, B6, INDEX(array, QUOTIENT(SEQUENCE(ROWS(array)*repeat, , 0), repeat)+1, SEQUENCE(, COLUMNS(array))))

    A formula cannot copy the colors of the original array.

    You might use conditional formatting rules to set the font color to red if the cell contains "red" etc.

  • m_tarler's avatar
    m_tarler
    Bronze Contributor

    There are a number of ways.  Here is one using 365:

    =CHOOSEROWS(Table1,INT(SEQUENCE(ROWS(Table1)*count,,1,1/count)))

     

Resources