Text to Columns
Upload a sheet or paste your cells, pick the column and the character to split at, and download the file with the pieces in separate columns.
Updated
How to split a column
- Choose your file, or paste cells copied from Excel or Google Sheets and select Use pasted data.
- Leave First row is a header ticked if row 1 holds column names.
- Under Column to split, choose the column that holds the combined text.
- Under Split at, choose the separator: Comma, Space, Semicolon, Tab, Pipe or Hyphen.
- Check Columns added and the preview.
- Select Download .xlsx or Download .csv.
The new columns take the place of the original one, and the columns to its right move over. Nothing is overwritten. Each piece has the spaces at its start and end removed, so “Lima, Ana” split at the comma gives “Lima” and “Ana” with no leading space. Rows with fewer pieces get empty cells at the end. With a header row, the new columns are named after the original with a number, such as Name 1 and Name 2.
Text to Columns in Excel itself
With the wizard
- Select the column to split. One column at a time.
- Go to Data > Text to Columns.
- Step 1: choose Delimited when a character separates the pieces, or Fixed width when each piece always starts at the same position. Select Next.
- Step 2: tick the delimiters, such as Comma or Space, or type another character next to Other. The preview at the bottom shows the result. Select Next.
- Step 3: select each column in the preview and set its format. Choose Text for codes with leading zeros and Date for dates. Set Destination to the first cell where the result should go.
- Select Finish.
By default the result starts in the original column and fills the columns to its right. If those columns hold data, Excel asks before replacing it. Insert enough empty columns first, or point Destination at free space.
In step 2, Treat consecutive delimiters as one helps when values are separated by several spaces.
With TEXTSPLIT
=TEXTSPLIT(A2, ", ")
TEXTSPLIT takes the text and then the column delimiter. The pieces spill across the row, and the result updates when A2 changes. It is available in Excel for Microsoft 365 and Excel for the web. Earlier versions show #NAME?.
To split at more than one separator, list them in braces:
=TEXTSPLIT(A2, {",", ";"})
Wrap the formula in TRIM to remove spaces left around the pieces: =TRIM(TEXTSPLIT(A2, ",")).
With Flash Fill
- In the column next to the data, type the piece you want from the first row, such as the first name.
- Select the cell below it and press Ctrl+E, or go to Data > Flash Fill.
Excel reads the pattern from your example and fills the rest of the column. Repeat for each piece. Flash Fill is in Excel 2013 and later. It guesses, so scan the result, especially rows that differ from your example. The values are fixed text and do not update when the source changes.
In Google Sheets
Select the column, then choose Data > Split text to columns. A small Separator menu appears below the data where you can pick the character or let Sheets detect it.
The formula version is SPLIT:
=SPLIT(A2, ",")
Which method to use
| Situation | Best option |
|---|---|
| A file you were sent, split once | This page, or the wizard |
| Columns to the right must not be overwritten | This page |
| Pieces sit at fixed positions, with no separator | The wizard with Fixed width |
| The split must update when the data changes | =TEXTSPLIT() in Microsoft 365 |
| The pattern is irregular, such as initials from names | Flash Fill |
| A whole CSV file opens in one column | CSV to Excel |
Mistakes to avoid
- Overwriting neighbouring data. The Excel wizard writes to the right of the original column. Make room before you run it.
- Splitting names at a space. “Ana Maria Lima” has two spaces and gives three pieces. Decide what to do with middle names before you split a long list.
- Separators inside the values. An address such as “12 High St, Flat 2, Leeds” splits at every comma. Count the pieces in the preview.
- Codes turned into numbers or dates. With the General format, Excel reads 00123 as 123 and 1-2 as a date. Set those columns to Text in step 3.
- Splitting at a hyphen in dates or phone numbers when only one part of the cell should be split. Check that the separator appears only where you expect.
Limits
- 50 MB per file. Formats: .xlsx, .xls, .xlsm, .csv, .tsv, .txt and .ods.
- One column and one separator per pass. To split a second column, upload the downloaded file again.
- Splitting is by separator only. Fixed-width splitting is not supported.
- The file is read on your device and is not uploaded.
- The download contains values. Formulas are replaced by their results, and cell formatting is not carried over.
Questions
How do I split text into columns in Excel?
Select the column, go to Data > Text to Columns, choose Delimited, tick the character that separates the pieces, and select Finish. Or use the tool above, which shows the split before you download it.
How do I split first and last names into two columns?
Choose the name column and split at Space. Names with more than two words produce a third column, so check the preview. In Excel 365, =TEXTSPLIT(A2, " ") does the same with a formula.
Is there a formula that splits a cell?
In Excel for Microsoft 365, =TEXTSPLIT(A2, ", ") splits the text of A2 at each comma followed by a space and spills the pieces across the row. In Google Sheets, use =SPLIT(A2, ",").
Does Text to Columns overwrite the cells to the right?
In Excel, yes. The pieces are written over the columns to the right of the original, after a warning. Insert empty columns first. This tool inserts new columns instead, so nothing is overwritten.
How do I keep leading zeros when splitting?
In step 3 of the Excel wizard, select each column that holds codes and set its format to Text. With the default General format, 00123 becomes 123.
What is the reverse of Text to Columns?
Joining. Use =A2&" "&B2 for two cells, or TEXTJOIN to join a range with a separator between the values.