How to Split Column in Excel by Comma (8 Quick Methods)

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.

Split Column in Excel by Comma with Convert Text to Columns Wizard

  • 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.

Output: Split Column in Excel by Comma with Convert Text to Columns Wizard


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

  • B5 has texts with a comma.
  • FIND(“,”,B5) looks for a comma within cell B5.
  • LEFT(B5,FIND(“,”,B5)-1) returns texts before the first comma appears from the left side.

Combining LEFT and FIND Functions to Split Column in Excel by Comma

  • Insert the following formula in cell D5.
=RIGHT(B5,LEN(B5)-FIND(",",B5))
  • Hit Enter.

Formula Breakdown

  • B5 has texts with a comma.
  • FIND(“,”,B5) looks for a comma within cell B5.
  • RIGHT(B5,LEN(B5)-FIND(“,”,B5)) returns texts after the first comma appears from the right side.

Combining RIGHT, FIND, and LEN Functions to Split Column in Excel by Comma

  • Select cells C5 and D5 and drag the Fill Handle icon down to cells C12 and D12.

  • These two formulas will split a column into two columns, separating the values before and after the comma.


Method 3 – Apply a Dynamic Array Formula to Split a Column

  • Insert the following formula in cell C5.

=TRANSPOSE(FILTERXML("<t><s>" &SUBSTITUTE(B5,",","</s><s>") & "</s></t>","//s"))

  • Hit Enter or Ctrl + Shift + Enter.

Formula Breakdown

  • SUBSTITUTE(B5,”,”,”</s><s>”)

The SUBSTITUTE function substitutes the comma in cell B5 with a space.

  • FILTERXML(“<t><s>” &SUBSTITUTE(B5,”,”,”</s><s>”)

The FILTERXML function filters out data separated by spaces.

  • TRANSPOSE(FILTERXML(“<t><s>” &SUBSTITUTE(B5,”,”,”</s><s>”) & “</s></t>”,”//s”))

The TRANSPOSE function splits the data in cell B5 into two different columns.

Apply Dynamic Array Formula to Split Column in Excel by Comma

  • Drag the Fill Handle icon from cell C5 to C12.

  • You will see the data split into two different columns.


Method 4 – Divide a Column in Excel by Comma Using Flash Fill

  • Insert the first value from the original cell in the first result cell (C5).
  • When you start entering the value in cell C6, Excel will show suggestions.
  • Press Enter to accept.

Divide Column in Excel by Comma Using Flash Fill

  • Repeat the process for column D.

  • You will get the data split into two different columns.


Method 5 – Split a Column in Excel by Comma Using a CSV File

  • Select and copy your data.

  • Open Notepad and hit Paste.

  • Save the file as a CSV file. To save a text file as a CSV file, edit the file extension as .CSV.

Split Column in Excel by Comma Using CSV File

  • Open the CSV file in Excel and you will see that the data has been automatically split by a comma into two columns.


Method 6 – Use VBA Code to Split a Column in Excel by a Comma

Consider the following dataset where we need to fill the Country and Capital City cells from the information in column B.

  • Press Alt + F11 to open the VBA Editor.
  • Go to Insert and select Module.

  • Insert the following VBA code in the VBA editor.
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

Use VBA Code to Split Column in Excel by Comma

Code Breakdown

  • We ran a Nested For loop with the Split and Cells functions to split data by a comma into two separate cells.
  • Save the VBA code.
  • Press the F5 button to run the code.
  • This will automatically split the column Country with Capital City into two columns: Country and Capital City.


Method 7 – Split a Column in Excel by a Comma Using Power Query

  • Go to Data and choose Get Data.
  • Select From File and choose From Excel Workbook.

Split Column in Excel by Comma Using Power Query

  • From the Navigator window, select your worksheet name.
  • Click on Transform Data.

  • Go to Transform, then to Split Column, and select By Delimiter.

Power Query Editor: Split Column in Excel by Comma Using Power Query

  • The Split Column by Delimiter dialog box will appear.
  • Select Comma from the Select or enter delimiter drop-down.
  • Hit OK.

  • Your data will be automatically split into two columns separated by a comma.


Method 8 – Divide a Column in Excel by a Comma Using Power Pivot

  • Go to Power Pivot and hit Add to Data Model.

Divide Column in Excel by Comma Using Power Pivot

  • Insert your table range in the Create Table dialog box and hit OK.

  • Insert the following formula in the top cell of the Calculated Column 1 column.
= LEFT ( [Country with Capital City], FIND ( ",", Table2[Country with Capital City]) - 1 )
  • Hit Enter.

Formula Breakdown

  • FIND ( “,”, Table2[Country with Capital City])

The FIND function looks for a comma within the column Country with Capital City.

  • LEFT ( [Country with Capital City], FIND ( “,”, Table2[Country with Capital City]) – 1 )

The LEFT function returns data before the comma from the left side.

  • The Calculated Column 1 will be filled with the data before the comma.

  • Insert the following formula in the top cell of the Calculated Column 2 column.
= RIGHT ([Country with Capital City], LEN (Table2[Country with Capital City]) - FIND ( ",", Table2[Country with Capital City]) )
  • Hit Enter.

Formula Breakdown

  • FIND ( “,”, Table2[Country with Capital City])

The FIND function looks for a comma within the column Country with Capital City.

  • LEN (Table2[Country with Capital City])

The LEN function calculates the length of the texts in the column Country with Capital City.

  • RIGHT ([Country with Capital City], LEN (Table2[Country with Capital City]) – FIND ( “,”, Table2[Country with Capital City]) )

The RIGHT function returns the data after the comma from the right side.

  • The Calculated Column 2 will be filled with the data after the comma appears.


Practice Section

We have included a practice sheet in the download file where you can test out the methods.


Download the Practice Workbook


Related Articles

Get FREE Advanced Excel Exercises with Solutions!
Mrinmoy Roy
Mrinmoy Roy

Mrinmoy Roy, a dedicated professional with a BSc in Electronics and Communication Engineering from Khulna University of Engineering & Technology, Bangladesh, brings over two years of expertise to the ExcelDemy project. As a prolific contributor, he has authored around 180 articles, showcasing his deep knowledge and passion for Microsoft Excel, Data Analysis, and VBA. His unwavering commitment to continuous learning, combined with versatile skills, renders him well-suited for roles in data management and spreadsheet solutions. He has interest... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo