How to convert column list to comma separated list in Excel?
If you want to convert a column list of data to a list separated by comma or other separators, and output the result into a cell as shown as below, you can get it done by CONCATENATE function or running a VBA in Excel.
- Convert column list to comma separated list with TEXTJOIN function
- Convert column list to comma separated list with CONCATENATE function
- Convert column list to comma separated list with VBA
- Convert column list to comma separated list with Kutools for Excel
- Reverse concatenate and convert one cell (a comma serrated list) to a row/column list in Excel
Convert column list to comma separated list with TEXTJOIN function
The Excel TEXTJOIN function joins multiple values from a row, column or a range of cells with specific delimiter.
Note that the function is only available in Excel for Office 365, Excel 2021, and Excel 2019.
To convert column list to comma separated list, please select a blank cell, for instance, the cell C1, and type this formula =TEXTJOIN(", ",TRUE,A1:A7) (A1:A7 is the column you will convert to comma serrated list, ", " indicates how you want to separate the list). See the screenshot below:
Convert column list to comma separated list with CONCATENATE function
In Excel, CONCATENATE function can convert the column list to a list in a cell separated by commas. Please do as follow:
1. Select a blank cell adjacent to the list's first data, for instance, the cell C1, and type this formula =CONCATENATE(TRANSPOSE(A1:A7)&",") (A1:A7 is the column you will convert to comma serrated list, "," indicates the separator you want to separate the list). See screenshots below:
2. Highlight the TRANSPOSE(A1:A7)&"," in the formula, and press the F9 key.
3. Remove curly braces {and } from the formula, and press the Enter key.
Now, you can see all values in the column list been converted a list in a cell and separated by comma. See screenshot above.
Quickly convert a column list to a comma separated list with Kutools for Excel
Kutools for Excel’s Combine Columns or Rows without Losing Data utility can help Excel users easily combine multiple columns or rows into one columns/row without losing data. In addition, Excel users can wrap these combined text strings with carriage or hard return.
Convert column list to comma separated list with VBA
If the CONCATENATE function is a little tedious for you, you can use a VBA to quickly convert the column list to a list in a cell.
1. Hold ALT button and press F11 on the keyboard to open a Microsoft Visual Basic for Application window.
2. Click Insert > Module, and copy the VBA into the module.
VBA: Convert column list to comma separated list
Sub ChangeRange()
'Updateby20140310
Dim rng As Range
Dim InputRng As Range, OutRng As Range
xTitleId = "KutoolsforExcel"
Set InputRng = Application.Selection
Set InputRng = Application.InputBox("Range :", xTitleId, InputRng.Address, Type:=8)
Set OutRng = Application.InputBox("Out put to (single cell):", xTitleId, Type:=8)
outStr = ""
For Each rng In InputRng
If outStr = "" Then
outStr = rng.Value
Else
outStr = outStr & "," & rng.Value
End If
Next
OutRng.Value = outStr
End Sub
3. Click Run button or press F5 to run the VBA.
4. A dialog displayed on the screen, and you can select the column list you want to convert. See screenshot:
5. Click OK, then another dialog popped up for you to select a cell. See screenshot:
6. Click OK, and all values in the column list have been converted to a list separated by comma in a cell.
Tip: In the above VBA, "," indicates the separator you need, and you can change it as you need.
Convert column list to comma separated list with Kutools for Excel
You can also apply Kutools for Excel’s Combine utility to combine a column list, and separate each value with comma easily.
Kutools for Excel - Supercharge Excel with over 300 essential tools. Enjoy a full-featured 30-day FREE trial with no credit card required! Get It Now
1. Select the column list that you will convert to a comma separated list, and click Kutools > Merge & Split > Combine Rows, Columns or Cells without Losing Data.
2. In the opening Combine Columns or Rows dialog box, you need to:
(1) Check the Combine rows option in the To combine selected cells according to following options section;
(2) In the Specify a separator section, check the Other separator option, and type comma , into following box;
3. Click the Ok button.
Now you will see all values in the specified column list are combined into one cell and converted to a comma separated list.
Kutools for Excel - Supercharge Excel with over 300 essential tools. Enjoy a full-featured 30-day FREE trial with no credit card required! Get It Now
Demo: convert column list to comma separated list in Excel
Reverse concatenate and convert one cell (a comma serrated list) to a row/column list in Excel
Normally Excel users can apply the Text to Columns feature to split one cell to multiple columns, but there is no directly method to convert one cell to multiple rows. However, Kutools for Excel’s Split Cells utility can help you easily get it done as below screenshot shown.