Repeat Values Variable Times on Each Row – Google Sheets

google sheets

I'd like to automatically populate a dynamic list where values are repeated on each row separately. The number of repetitions is in column A and the value to repeat is in column B. The formula should go into column C, like this:

table expected behaviour

Best Answer

You can repeat values with the sequence() function like this:

=sequence(1, A2, B2, 0)

...where A2 contains the number of repetitions and B2 contains the value to repeat.

See sequence().