-1

I need to repeat a value x time in rows. when it is done repeat another value n time. I found SEQUENCE() but it works only for the first value.

EXAMPLE:

Repeat in rows starting from C1
Repeat A1 value: 42
N time A2 value: 3
then Repeat B1 value: 67
M time B2 value: 5

In C8 I should have the last 67 value

Is there a way to concatenate the =SEQUENCE?

Thanks enter image description here

Column A Column B
42 67
3 5
JvdV
  • 70,606
  • 8
  • 39
  • 70
Frankie
  • 1
  • 1
  • You could have searched the StackOverflow, same query was resolved earlier and here is the solutions given [Repeat](https://stackoverflow.com/questions/74181973/is-there-a-non-vba-excel-spilling-formula-to-create-and-process-arrays-of-arrays) – Mayukh Bhattacharya Nov 25 '22 at 12:20

2 Answers2

2

Give a try on the following formula-

=TEXTSPLIT(CONCAT(REPT(A1:B1&"|",A2:B2)),,"|")

enter image description here

Harun24hr
  • 30,391
  • 4
  • 21
  • 36
2

You could use EXPAND() for example:

enter image description here

=VSTACK(EXPAND(A1,A2,,A1),EXPAND(B1,B2,,B1))

Or go with a somewhat more expandable option:

=XLOOKUP(SEQUENCE(SUM(A2:B2)),SCAN(0,A2:B2,LAMBDA(a,b,a+b)),A1:B1,,1)
JvdV
  • 70,606
  • 8
  • 39
  • 70