How to copy a cell in Google Sheets n times in adjacent cells of the row when n=the value of the cell?

There is an array of type:
5e4c9e09f3d0d101703788.jpeg
You need to fill in the value of the second cell of the row n left neighboring cells, where n = the value of the first cell of the row.
Example desired result:
5e4c9e7ba5d7e126664623.jpeg
Is it possible to solve this task without plugins, only some built-in tools GSheets?
April 7th 20 at 15:47
1 answer
April 7th 20 at 15:49
Formula with SLIPT seems reasonable

=IFERROR(SPLIT(REPT(B2&"|";A2);"|");"")

5e4cd57fbd121766332362.png

Also supports ARRAYFORMULA

=ARRAYFORMULA(IFERROR(SPLIT(REPT(B2:B&"|";A2:A);"|");""))


Table with example.

Sincerely,
contributor.pw

Find more questions by tags Google Sheets