1

I would like to ask for your advices. I have a problem with this enter image description here
I tried to use REPT in excel but the result show all multiplied word in on cell. How Can I improve it?

I want to result be like

enter image description here

and sort from Z to A by code. How can I do it. Thank you so much

Ike
  • 9,580
  • 4
  • 13
  • 29

3 Answers3

3

Try the following formula-

=DROP(TEXTSPLIT(CONCAT(REPT(A1:A3&"|",B1:B3)),,"|"),-1)

enter image description here

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

This post and this one are very similar, if not a duplicate. Maybe the only thing that tells these apart is the fact that you seem to want a "z..a" order (which does not reflect in your desired result btw). I did implement it here below:

enter image description here

Formula in D1:

=SORT(XLOOKUP(SEQUENCE(SUM(B1:B3)),SCAN(0,B1:B3,LAMBDA(a,b,a+b)),A1:A3,,1),,-1)
JvdV
  • 70,606
  • 8
  • 39
  • 70
1

Another solution - using MAKEARRAY:

=LET(d,A1:B3,
m,MAKEARRAY(ROWS(d),MAX(INDEX(d,,2)),LAMBDA(r,c,IF(c<=INDEX(d,r,2),INDEX(d,r,1),#N/A))),
SORT(TOCOL(m,2),,-1))

I added SORT at the end as you wrote "sort from Z to A by code"

Ike
  • 9,580
  • 4
  • 13
  • 29