2000 item numbers in a column to a delimited row

IsaacR

New Member
Joined
Jun 25, 2023
Messages
2
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
I have 2000 item numbers in a column that I was able to get into a delimited row with commas. I was wondering how to break these into groups of 30 item numbers.

I was using =TEXTJOIN(", ",,A1:A30)
=TEXTJOIN(", ",,A31:A60) ETC. It works great but super tedious. Any suggestions?
Thank you
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
You could use VBA. Below assumes items are in col A starting in cell A2. This puts all the items into a comma-delimited list in cell C2.
VBA Code:
Sub Isaac()
Dim V As Variant, S As String
V = Range("A2:A" & Cells(Rows.Count, "A").End(xlUp).Row).Value  'change range to suit
S = Join(Application.Transpose(V), ",")
Range("C2").Value = S
End Sub
 
Upvote 0
Does this formula give you what you want...
Excel Formula:
=BYROW(WRAPROWS(A1:A2000,30),LAMBDA(r,TEXTJOIN(", ",,r)))
 
Upvote 0
Does this formula give you what you want...
It doesn't for me - because 2,000 rows is not a multiple of 30 so a #N/A value appears in the final row instead of the final 20 values.
This would fix it though
Excel Formula:
=BYROW(WRAPROWS(A1:A2000,30,""),LAMBDA(r,TEXTJOIN(", ",,r)))

This one also worked for me.
Excel Formula:
=TEXTSPLIT(TEXTJOIN(TEXTSPLIT(REPT(", .",29)&"|","."),1,A1:A2000),,"|")
 
Upvote 0
It did, thank you very much :)
Did you see Peter_SSs' reply to my post (Message #5) in which he specified a value ("") for an optional argument that I accidentally omitted which will suppress #N/A errors at the bottom of the list if the columns are not fully populated?
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,217
Members
453,024
Latest member
Wingit77

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