How to split text into columns in Excel (Text to Columns)

Quick answer: Select the column that holds the text, then go to Data > Text to Columns. Pick Delimited and select Next; choose the character that separates the parts, such as Comma or Space, and watch the Data preview. Select Next, set Destination to an empty cell so the original column stays as it is, and select Finish. In Excel for Microsoft 365 or Excel 2024 you can get the same split as a formula, for example =TEXTSPLIT(A2,”,”).

Applies to: Excel for Microsoft 365, Excel 2024, Excel 2021, Excel 2019 and Excel 2016 on Windows for the Text to Columns wizard, which Microsoft also lists for Excel for the web. The TEXTSPLIT function is listed only for Excel for Microsoft 365 (Windows and Mac), Excel 2024 (Windows and Mac) and Excel for the web. The methods start with the simplest one.

Which method to use

Splitting means taking one cell such as Lopez, Maria, Denver and spreading its pieces across several cells, one piece per column. Excel needs a rule for where to cut: either a separator character that appears between the pieces (a comma, a space, a semicolon, a tab) or a fixed character position, which suits codes where each part always has the same length.

Text to Columns is a one-time conversion. The result is plain values, so if the source text changes later, the split cells stay as they were. TEXTSPLIT is a formula: it rebuilds the pieces whenever the source cell changes, which suits a sheet you paste fresh data into every week. Flash Fill sits in between; it learns from an example you type, which helps when the pieces aren’t separated by one clean character.

If what you actually need is to turn rows into columns rather than cut text apart, that’s a different job; see How to transpose rows and columns in Excel.

Method 1: Split by a delimiter with Text to Columns

These are the steps Microsoft’s wizard article gives. Before you start, make sure the columns to the right of your data are empty, or plan to send the result somewhere else in step 6.

  1. Select the cell or the whole column that contains the text. Select a single column; the wizard splits one column at a time.
  2. On the Data tab, select Text to Columns.
  3. In the wizard, choose Delimited and select Next.
  4. Under Delimiters, check the separator your data uses, for example Comma and Space for an entry like Lopez, Maria. If it isn’t listed, use Other and type the character. The Data preview shows where the cuts will fall.
  5. Select Next.
  6. In Destination, pick the first cell where the split data should go, ideally an empty area or the column next to an empty block.
  7. Select Finish.

Why the destination matters: Microsoft’s page only says to choose where the result goes, but by default the box points at the cell you selected. Left that way, the first piece replaces your original text and the remaining pieces fill the columns to the right, so anything already there can be overwritten. Excel should warn before replacing existing data; if you click through by mistake, press Ctrl+Z right after to undo the split.

Two delimiter options aren’t described on the page cited here but appear in the wizard in current versions: a check box to treat consecutive delimiters as one (useful when names are separated by double spaces) and a Text qualifier list, normally set to a double quote, so a quoted value such as “Denver, CO” stays in one cell. Labels can vary slightly by version.

Method 2: Split at fixed positions (Fixed width)

Pick Fixed width instead of Delimited on the first screen when each part always takes the same number of characters, for example product codes like AB2024X where the first two letters, the four digits and the last letter mean different things. The fixed-width steps weren’t part of the text returned from Microsoft’s page, so treat this as an outline:

  1. Select the column, then Data > Text to Columns and choose Fixed width.
  2. On the next screen, click in the preview ruler to add a break line where a new column should start. Drag a line to move it, or double-click it to remove it.
  3. Select Next, set the column formats and the Destination, then select Finish.

Fixed width ignores separators completely. If even one row is shorter or longer than the rest, its pieces shift, so scan the preview before you finish.

Keep leading zeros and dates intact

The wizard’s last screen lets you set a Column data format for each new column. Microsoft’s article as returned doesn’t describe this screen, so the details below are hedged, but it’s where these problems get fixed:

  • Leading zeros: with the default General format, Excel converts a piece like 00451 to the number 451. Click that column in the preview and choose Text to keep the zeros, for ZIP codes, employee IDs or part numbers.
  • Dates: if a piece holds a date written day-first or month-first, choose Date and the matching order (such as MDY or DMY) so Excel doesn’t swap the day and month.
  • Pieces you don’t need: select the column in the preview and choose Do not import column (skip) to leave it out of the result.

Method 3: Split with the TEXTSPLIT function

Microsoft describes TEXTSPLIT as the formula version of the Text to Columns wizard, and as the reverse of TEXTJOIN. It’s on the Applies To list for Excel for Microsoft 365, Excel 2024 and Excel for the web, not for Excel 2021 or earlier. The syntax is:

=TEXTSPLIT(text, col_delimiter, [row_delimiter], [ignore_empty], [match_mode], [pad_with])

  • text: the cell to split, for example A2.
  • col_delimiter: the character that starts a new column, such as ” ” or “,”.
  • row_delimiter (optional): a character that starts a new row instead.
  • ignore_empty (optional): TRUE skips the empty pieces that two delimiters in a row would create; the default, FALSE, keeps them as blank cells.
  • match_mode (optional): 1 makes the delimiter match ignore upper and lower case; the default, 0, is case-sensitive.
  • pad_with (optional): what to put in gaps when rows end up with different numbers of pieces. Without it, the gaps show #N/A.

Click an empty cell and type, for example, =TEXTSPLIT(A2,” “) to split a full name at each space, then press Enter. For more than one separator, put them in an array constant: =TEXTSPLIT(A2,{“,”,”;”}) cuts at both commas and semicolons. Using both delimiters, as in =TEXTSPLIT(A2,”,”,”;”), turns text like 1,2,3;4,5,6 into a small grid of two rows and three columns. If you see #N/A in the gaps, Microsoft’s tip is to add the pad_with argument or wrap the formula in IFNA.

The result spills into the cells to the right (and below, if you use a row delimiter), so those cells need to be empty. If they aren’t, the formula should show #SPILL!; #SPILL! error in Excel shows how to clear the way. TEXTSPLIT works on one cell per formula, so fill the formula down for each row of data.

Method 4: Let Flash Fill copy a pattern

Flash Fill can pull out a piece of text by example, which helps when there isn’t one clean separator, such as taking only the first name out of “Maria Lopez (Sales)”. Microsoft’s Flash Fill article, which uses splitting first and last names as its example, gives these steps. It lists Excel for Microsoft 365, Excel 2024, 2021, 2019 and 2016 and Excel 2024 and 2021 for Mac, but not Excel for the web:

  1. In the column next to your data, type the result you want for the first row, for example Maria.
  2. Start typing the entry for the next row. Excel can show a preview for the rest of the column; press Enter to accept it. If no preview appears, select the cell below your first entry and press Ctrl+E, or go to Data > Flash Fill.
  3. Look down the filled column. Flash Fill guesses the pattern, so check rows that differ from the first one (a middle name, a missing comma) and correct one of them if needed, which can make it refill the rest.

Microsoft’s article doesn’t say whether the results update, but the filled cells should hold plain values, not formulas, so don’t expect them to follow later changes to the source column. Run it again, or use TEXTSPLIT, if the source keeps changing.

Excel for the web and Excel for Mac

Excel for the web: Microsoft lists Excel for the web for both the Text to Columns wizard and TEXTSPLIT, but the wizard article returned no separate web steps. Look for Text to Columns on the Data tab; the browser version may offer fewer options than the desktop wizard. If an option you need is missing, TEXTSPLIT works the same way in the browser, or open the file in the desktop app.

Excel for Mac: TEXTSPLIT is listed for Excel for Microsoft 365 for Mac and Excel 2024 for Mac. The wizard article as returned doesn’t list Mac, though Excel for Mac has a Text to Columns command on its Data tab in current versions; the steps should match Method 1, with Command in place of Ctrl for shortcuts.

When the split goes wrong

The causes below are possibilities to check, not a diagnosis.

What you seePossible causeWhat to try
Original text replacedDestination was left on the source cellUndo with Ctrl+Z, then set an empty Destination
Leading zeros are goneColumn was imported as GeneralChoose Text for that column on the last step
Day and month swappedWrong date order on importChoose Date with the right order, or Text
Extra empty columnsTwo separators in a rowTreat consecutive delimiters as one, or ignore_empty TRUE
#N/A in a TEXTSPLIT resultRows have different numbers of piecesAdd pad_with or wrap in IFNA
#SPILL! instead of a resultCells to the right aren’t emptyClear the blocking cells (Method 3)

Once the data is in separate columns, repeated rows are easier to spot and remove; How to remove duplicates in Excel covers that, and How to create a pivot table in Excel can then summarize the new columns. If the goal was only to make long text readable inside one cell, wrapping it may be enough; see Wrap Text not working in Excel.

Sources

How we write our guides: read our editorial policy.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *