Sub topic 10
Split combined values with Split text to columns
This chapter covers the menu tool that breaks one column of combined values into several columns. It assumes you can select ranges and use the menu bar, and that you have trimmed whitespace in an earlier chapter. You do not need any formulas to follow it. The formula version, SPLIT, comes in the next chapter.
Why combined values cause trouble
A combined value packs two or more facts into one cell. Typical examples:
Doe, Jane(last name and first name)Austin; TX; 78701(city, state, and postal code)red/blue/green(a list of tags)2026-11-28 14:30(a date and a time)
A cell like this can't be sorted by last name or filtered by state. A pivot table can't count how many rows are in Texas. A lookup can't match Jane against Doe, Jane. Splitting the cell into one fact per column fixes all of this, because each column then holds one kind of value.
What the tool does
Split text to columns looks for a separator character in each selected cell. It cuts the text at every separator and writes the pieces into the cell and the cells to its right. The separator itself is discarded.
Three properties matter for everything that follows:
- It works on one column at a time. Select a single column of cells, not a multi-column range.
- It writes plain values, not formulas. If the source cells change later, the split cells do not update.
- It writes into the same rows, in the columns immediately to the right of the selection. Whatever is there needs to be empty or expendable.
The diagram shows a detail that catches many people. If you split Doe, Jane on a comma only, the second piece is Jane with a leading space. That space is exactly the kind of invisible mess you are trying to remove. Plan a trim step after the split, or include the space in the separator.
Step by step
1. Protect the original
The tool overwrites cells and has no memory of the original text. Before you split, duplicate the sheet (right-click the tab, then Duplicate) or copy the column to a spare column. If the split goes wrong, you can start over from the raw data.
2. Make room on the right
Count how many pieces the longest value will produce. Doe, Jane gives two pieces. Mary Ann Smith split on spaces gives three. You need that many columns, starting at the selected column, free of other data. If a needed neighbor column holds data, insert new columns first (right-click a column header, then Insert 1 column right).
3. Select the cells
Click the column header, or select only the data cells such as A2:A500. Selecting a header row along with the data will split the header as well.
4. Run the tool
- Choose Data > Split text to columns.
- A small Separator dropdown appears at the bottom of the selected cells, and Sheets splits the data right away using its best guess.
- If the guess is wrong, open the dropdown and pick the correct separator. The result updates immediately.
5. Trim and check the result
Look at the new columns. Check the longest and shortest rows, not just the first few. Then run Data cleanup > Trim whitespace on the new columns to remove leftover spaces.
Choosing a separator
| Option | Splits on | Use it for | Column |
|---|---|---|---|
| Detect automatically | Whatever Sheets guesses | Quick looks at simple data | |
| Comma | `,` | Lists and `Last, First` names | |
| Semicolon | `;` | European CSV exports, multi-value fields | |
| Period | `.` | Version numbers, domain parts | |
| Space | A single space character | Splitting `First Last` names | |
| Custom | The text you type | Pipes `\ | `, slashes, dashes, tabs pasted in |
Automatic detection is convenient but unpredictable. If your data has a comma in most rows and a semicolon in a few, the guess may fit only some rows. Choose the separator yourself whenever the result matters.
Custom is the escape hatch. Type the separator into the box, for example | or /. You can also use it to split on a comma followed by a space. If you type more than one character, test a few rows first and check whether Sheets cut at the whole string or at each character. Both behaviors exist in Sheets, and the SPLIT function makes you choose explicitly, as the next chapter shows.
A worked example
Suppose column A holds exported contact names:
Doe, Jane
Smith, Robert
Lee, AnaYou want last names in column A and first names in column B.
- Duplicate the sheet and name the copy
contacts_clean. - Confirm that column B is empty. If it is not, insert a column to the right of A.
- Select
A2:A4. - Choose Data > Split text to columns and set the separator to Comma.
The result looks right at first glance:
| A | B |
|---|---|
| Doe | ` Jane` |
| Smith | ` Robert` |
| Lee | ` Ana` |
Every value in column B starts with a space. A lookup for Jane will fail against Jane, which is the original problem in a new place. Select B2:B4 and run Data > Data cleanup > Trim whitespace. The leading spaces are gone.
To avoid that extra step, choose Custom and type a comma followed by a space. Then the space is part of the separator and never reaches column B. This only works if every row has exactly one space after the comma, so check the data first.
You can also confirm that a trimmed cell is clean with a formula in a spare column:
=LEN(B2) = LEN(TRIM(B2))This returns TRUE when the cell has no extra spaces. Fill it down and look for any FALSE.
Edge cases and common errors
Numbers, dates, and leading zeros
After splitting, Sheets converts pieces that look like numbers or dates. A postal code 02134 becomes 2134. A piece such as 3-4 can turn into a date. If you are splitting data with codes, IDs, or ranges, check the first column of results for lost zeros. Setting the destination columns to Format > Number > Plain text before the split often prevents the conversion. Test this on a copy of the data before relying on it.
Rows with a different number of pieces
Rows rarely have the same number of separators. Doe, Jane gives two pieces, while Doe, Jane, Jr. gives three. The extra piece spills into a column you may not have planned for, and it may overwrite data there. Scan the widest result before you trust the layout. A quick check on a copy is a count of non-empty cells per row:
=COUNTA(A2:D2)Fill this down next to the results. Any row with a different count from the rest deserves a look.
Separators inside the data
A comma-separated column can contain values like Acme, Inc. in the company field. The tool can't tell a separator from a comma that belongs to the text, so it splits both. Fix such rows by hand, or choose a separator that does not occur inside the values (a semicolon or pipe, if the source uses one).
Not enough room
If the pieces would land in columns that already contain data, Sheets may stop with an error saying there is not enough space, or it may overwrite those cells, depending on the situation. Don't depend on either outcome. Insert columns before you split.
Static results
Because the output is plain values, a later edit to the source cell does not change the pieces. If new rows arrive regularly, you must rerun the tool on them. For data that keeps changing, the SPLIT function in the next chapter recalculates by itself.
Merged cells and filtered rows
Merged cells in the selection can produce odd results, so unmerge them first. If a filter is active, make sure the intended rows are the ones selected. Clear the filter before you split if you want every row processed.
When to use the tool
Use the menu tool when the data is a one-time import, when you want plain values to keep, and when you can look at the result right away. Use a formula when the data is updated over time. The tool is also a good way to explore: you can try three separators in ten seconds and see which one fits.
Summary
- Split text to columns cuts each selected cell at a separator and writes the pieces to the right, as static values.
- Make a copy, free up the columns to the right, and select one column of data cells.
- Pick the separator yourself instead of trusting automatic detection when accuracy matters.
- Expect leading spaces after splitting on a bare comma, and trim afterward.
- Check for lost leading zeros, unexpected date conversions, rows with extra pieces, and separators that occur inside values.
Exercise
Column A contains Garcia; Maria; 02134. You select A2:A100 and use Split text to columns with Semicolon as the separator. Name two problems you should expect in the result, and say how you would handle each.
Show answer
First, the second and third pieces start with a space ( Maria, 02134), so lookups against Maria will fail. Run Data cleanup > Trim whitespace on the new columns, or use Custom with a semicolon followed by a space as the separator. Second, the postal code 02134 can lose its leading zero because Sheets converts it to the number 2134. Format the destination column as Plain text before splitting and check the result, or restore the zeros afterward. Before splitting, also confirm that columns B and C are empty and that you worked on a copy.
Exercise
You split a column of names on a comma, and one row ends up with an extra value in a column that you did not expect. What likely caused it, and which formula can help you find all such rows?
Show answer
That row had more separators than the others (for example Doe, Jane, Jr. or Acme, Inc.), so it produced an extra piece. Fill =COUNTA(A2:D2) down in a spare column and look for rows whose count differs from the rest. Then fix those rows by hand or choose a separator that does not appear inside the values.