- To post as a guest, your comment is unpublished.· 5 months agoHello, trinetta,
May be the following article can help you, in that article, there are some formulas may meet your need. Please check it:
- To post as a guest, your comment is unpublished.· 5 months agoThe link only tells me how to do the same thing. It doesnt tell me how to tell the code or formula how many columns i need...just how many in each column.
- To post as a guest, your comment is unpublished.· 5 months agoHi, Tpdixon,
In that article, the formula: =OFFSET($A$1,COLUMNS($A1:A1)-1+(ROWS($1:1)-1)*5 can help you to split the list into mulitiple columns, you just need to change the number 5 to other number you need, it represents the column number.
After entering this formula, you should drag the fill handle acrross to right with 5 cells.
Please try, thank you!
How to split a long list into equal groups in Excel?
If you have a long list of data needed to be split into multiple equal groups as following screenshot shown, how could you deal with this task quickly and easily in Excel?
Excepting copy and paste the data one by one, the following VBA code also can do you a favor, please do with following steps:
1. Hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window.
2. Click Insert > Module, and paste the following code in the Module Window.
VBA code: Split a long list into multiple equal groups
Sub SplitIntoCellsPerColumn() 'updateby Extendoffice Dim xRg As Range Dim xOutRg As Range Dim xCell As Range Dim xTxt As String Dim xOutArr As Variant Dim I As Long, K As Long On Error Resume Next xTxt = ActiveWindow.RangeSelection.Address Sel: Set xRg = Nothing Set xRg = Application.InputBox("please select data range:", "Kutools for Excel", xTxt, , , , , 8) If xRg Is Nothing Then Exit Sub If xRg.Areas.Count > 1 Then MsgBox "does not support multiple selections, please select again", vbInformation, "Kutools for Excel" GoTo Sel End If If xRg.Columns.Count > 1 Then MsgBox "does not support multiple columns,please select again", vbInformation, "Kutools for Excel" GoTo Sel End If Set xOutRg = Application.InputBox("please select a cell to put the result:", "Kutools for Excel", , , , , , 8) If xOutRg Is Nothing Then Exit Sub I = Application.InputBox("the number of cell per column:", "Kutools for Excel", , , , , , 1) If I < 1 Then MsgBox "incorrect enter", vbInformation, "Kutools for Excel" Exit Sub End If ReDim xOutArr(1 To I, 1 To Int(xRg.Rows.Count / I) + 1) For K = 0 To xRg.Rows.Count - 1 xOutArr(1 + (K Mod I), 1 + Int(K / I)) = xRg.Cells(K + 1) Next xOutRg.Range("A1").Resize(I, UBound(xOutArr, 2)) = xOutArr End Sub
3. Then press F5 key to run this code, and in the popped out box, please select the column that you want to split into multiple groups, see screenshot:
4. And click OK button, then select a cell where you want to locate the result in the following prompt box, see screenshot:
5. Click OK, and please enter the number of cells that you want to split per column in the prompt box, see screenshot:
6. Finally, click OK to finish the code, and the selected list data has been split into multiple equal groups as you need, see screenshot:
If you have installed Kutools for Excel, with its Transform Range feature, you can quickly split a long list into multiple columns and rows, moreover, you can also combine multiple columns into one long list.
|Kutools for Excel : with more than 300 handy Excel add-ins, free to try with no limitation in 30 days.|
After installing Kutools for Excel, please do as follows:
1. Select the long list that you want to split, and then click Kutools > Range > Transform Range, see screenshot:
2. In the Transform Range dialog box, select Single column to range under the Transform type section, and then check Fixed value and specify the number of cells per row in the box, see screenshot:
3. Then click Ok, and select a cell where you want to locate the result in the prompt box, see screenshot:
4. And click OK button, the data in the list has been split into multiple equal groups as you need.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
- To post as a guest, your comment is unpublished.· 5 months agothe code works great for me. How do I change it from asking how many in each colum to how many columns needed? so that it equally divides the information into a set number of columns.
- To post as a guest, your comment is unpublished.· 5 months agohow can I change it from the number of cells per column to the number of columns needed. so that the data is split up evenly amongst a number of columns instead of picking how many to have in each column?
- To post as a guest, your comment is unpublished.· 1 years agoI copied the code and Excel 365 says syntax error.
- To post as a guest, your comment is unpublished.· 2 years agoThis comes in very handy! One question: In the VBA code how can I transpose the output? So instead of xRg.Rows.Count / I = number of colums output, the output is generated as xRg.Rows.Count / I = number of rows output with I being the number of columns per row.