Expand each row n number of times.

Cubist

Well-known Member
Joined
Oct 5, 2023
Messages
1,803
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
I want to expand each row of my data n number of times. In the example, each item# gets repeated 3 times.
Book1
ABCDEFGH
1Num to repeat3
2Result
3Item#ProductDescriptionItem#ProductDescription
41Product ADesc A1Product ADesc A
52Product BDesc B1Product ADesc A
63Product CDesc C1Product ADesc A
74Product DDesc D2Product BDesc B
85Product EDesc E2Product BDesc B
92Product BDesc B
103Product CDesc C
113Product CDesc C
123Product CDesc C
134Product DDesc D
144Product DDesc D
154Product DDesc D
165Product EDesc E
175Product EDesc E
185Product EDesc E
19
Sheet2
 
why didn't the TEXTSPLIT(G4#,"|") in column H in post #5 spill to the right for each row
Because it doesn't work like that, when you pass an array of values you only get the column from the split.
 
Upvote 0

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
You're welcome & thanks for the feedback.
 
Upvote 0
D4: =SEQUENCE(COUNTA(B4:B8)*B1)
E4: =INDEX(B4:C8,ROUNDUP(D4#/B1,0),SEQUENCE(,COLUMNS(B4:C4)))
 
Upvote 0
Thanks, Dave. That's quite clever using SCAN.
 
Upvote 0
I was able to finish out post #5. Probably not the most efficient but just wanted the satisfaction knowing that it's possible.
SplitNameEmail.xlsx
ABCDEFG
1Num to repeat3
2
3Item#ProductDescriptionResult
41Product ADesc A1Product ADesc A
52Product BDesc B1Product ADesc A
63Product CDesc C1Product ADesc A
74Product DDesc D2Product BDesc B
85Product EDesc E2Product BDesc B
92Product BDesc B
103Product CDesc C
113Product CDesc C
123Product CDesc C
134Product DDesc D
144Product DDesc D
154Product DDesc D
165Product EDesc E
175Product EDesc E
185Product EDesc E
Sheet5
Cell Formulas
RangeFormula
E4:G18E4=LET(t,TEXTBEFORE((TOCOL(BYROW(A4:C8,LAMBDA(br,TEXTJOIN("|",TRUE,br)))&"*"&SEQUENCE(,B1))),"*"),TEXTSPLIT(TEXTJOIN(",",,t),"|",","))
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,223,275
Messages
6,171,122
Members
452,381
Latest member
Nova88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top