Text Formulas

How to Split Text by a Delimiter in Google Sheets

Split text into separate columns in Google Sheets with Split text to columns or the SPLIT function, and handle multiple separators and blank results.

On this page
  1. Use Split text to columns for a one-time split
  2. Use SPLIT for a formula that updates
  3. Know what the optional arguments do
  4. Make the results vertical
  5. Fix errors
  6. In Excel

Use Split text to columns for a one-time split

Select the column that holds the values, then go to Data > Split text to columns. Choose the separator from the menu, such as Comma, or a custom separator for anything else, such as a dash or a semicolon. Each value is split into the columns to its right.

This changes the cells directly, and it overwrites anything in the columns to the right. Leave those columns empty first. Because it’s a one-time change, the result won’t update if the source values change. For that, use a formula.

Use SPLIT for a formula that updates

SPLIT takes the text and a separator, and returns each piece in its own cell. If A2 holds red,green,blue, put this in B2:

=SPLIT(A2,",")

B2 shows red, C2 shows green, and D2 shows blue. The results spill across the row from the cell with the formula, so the cells to the right must be empty. If they aren’t, Google Sheets shows an error and doesn’t overwrite your data.

Know what the optional arguments do

SPLIT has four arguments: the text, the delimiter, split_by_each, and remove_empty_text. The last two are optional, and both default to TRUE.

  • split_by_each: With TRUE, each character in the delimiter splits the text on its own. So =SPLIT(A2,", ") splits on commas and on spaces. A value like “Ann Lee, Sam” then splits into three pieces, not two. To split on the whole “, “ string, set the argument to FALSE: =SPLIT(A2,", ",FALSE).
  • remove_empty_text: With TRUE, empty results are dropped, so “a,,c” returns just two pieces. Set it to FALSE to keep the empty middle piece, which matters when the columns have to line up.

To split on either of two separators, put both in the delimiter: =SPLIT(A2,",;") with the default settings splits on a comma or a semicolon.

Make the results vertical

SPLIT returns a row. To stack the pieces down a column, wrap it in TRANSPOSE:

=TRANSPOSE(SPLIT(A2,","))

Fix errors

  • A blocked spill. If the cells to the right of a SPLIT aren’t empty, the results can’t spill, and Google Sheets shows an error. Clear those cells, or move the formula.
  • A parse error. In some locales, Google Sheets uses semicolons instead of commas to separate function arguments, and a formula written with commas then fails. If you see a parse error, check the spreadsheet’s locale setting. The steps are in google sheets formula parse error.

In Excel

Excel has no SPLIT function. It has two options. Data > Text to Columns works like the Google Sheets menu option. TEXTSPLIT in Microsoft 365 is a formula that spills its results, and the rules for spilling are in what are dynamic array formulas in excel. A spill that runs into data produces the error covered in how to fix #spill error in excel.

The complete guide to text formulas

Text Formulas in Excel Explained
Read the guide

Keep exploring

Guides from other topics

All topics →