Method 1 – Split a Column in Excel by Commas with the Convert Text to Columns Wizard
- Select your data.
- Go to Data, then to Data Tools, and select Text to Columns.
- The Convert Text to Columns Wizard will appear.
- Select Delimited and hit Next.
- Select Comma for Delimiters and hit Next.
- Insert a cell address as the Destination and hit Finish.
- This will split a column in the place of a comma into two columns.
Method 2 – Combining LEFT, RIGHT, FIND, and LEN Functions to Split a Column in Excel by the Comma
- Insert the following formula in cell C5.
=LEFT(B5,FIND(",",B5)-1)
- Press Enter.
Formula Breakdown Formula Breakdown Formula Breakdown The SUBSTITUTE function substitutes the comma in cell B5 with a space. The FILTERXML function filters out data separated by spaces. The TRANSPOSE function splits the data in cell B5 into two different columns. Consider the following dataset where we need to fill the Country and Capital City cells from the information in column B. Code Breakdown Formula Breakdown The FIND function looks for a comma within the column Country with Capital City. The LEFT function returns data before the comma from the left side. Formula Breakdown The FIND function looks for a comma within the column Country with Capital City. The LEN function calculates the length of the texts in the column Country with Capital City. The RIGHT function returns the data after the comma from the right side. We have included a practice sheet in the download file where you can test out the methods. Download the Practice Workbook
=RIGHT(B5,LEN(B5)-FIND(",",B5))
Method 3 – Apply a Dynamic Array Formula to Split a Column
=TRANSPOSE(FILTERXML("<t><s>" &SUBSTITUTE(B5,",","</s><s>") & "</s></t>","//s"))
Method 4 – Divide a Column in Excel by Comma Using Flash Fill
Method 5 – Split a Column in Excel by Comma Using a CSV File
Method 6 – Use VBA Code to Split a Column in Excel by a Comma
Sub Split_Column_by_Comma()
Dim xArray() As String
Dim xCount As Long
Dim k As Variant
For h = 5 To 12
xArray = Split(Cells(h, 1 + 1), ",")
xCount = 3
For Each k In xArray
Cells(h, xCount) = k
xCount = xCount + 1
Next k
Next h
End Sub
Method 7 – Split a Column in Excel by a Comma Using Power Query
Method 8 – Divide a Column in Excel by a Comma Using Power Pivot
= LEFT ( [Country with Capital City], FIND ( ",", Table2[Country with Capital City]) - 1 )
= RIGHT ([Country with Capital City], LEN (Table2[Country with Capital City]) - FIND ( ",", Table2[Country with Capital City]) )
Practice Section
Related Articles
Get FREE Advanced Excel Exercises with Solutions!