Going Stellar

Home/Google Sheets reference

Google Sheets function · Text

SPLIT in Google Sheets: syntax and examples

SPLIT divides a text at a delimiter and puts each piece in its own cell, to the right of the formula. It is the quick way to separate names, codes and lists.

Syntax

SPLIT(text, delimiter, [split_by_each], [remove_empty_text])

Arguments

ArgumentTypeRequiredWhat it does
texttextyesThe text to cut. Use a single cell or a string. A range is cut only in its first cell.
delimitertextyesThe character or string to split on.
split_by_eachbooleannoTRUE (default) splits on each character of delimiter. FALSE splits only on the whole string.
remove_empty_textbooleannoTRUE (default) drops empty pieces. FALSE keeps them as empty cells.

Examples

The examples use this table, starting in A1:

red,green,blue
B-300-XL
Ana Pop
a1
=SPLIT(A1, ",")

Result:

redgreenblue

Comma separated words go into three cells in a row.

Run in a Google Sheet (English US locale) on .

=SPLIT(A2, "-")

Result:

B300XL

A code cut at each hyphen.

Run in a Google Sheet (English US locale) on .

=SPLIT(A3, " ")

Result:

AnaPop

First and last name into two cells.

Run in a Google Sheet (English US locale) on .

=SPLIT("a, b; c", ", ;")

Result:

abc

Several delimiter characters at once: the text is cut at every comma, space and semicolon, and empty pieces are dropped.

Run in a Google Sheet (English US locale) on .

=SPLIT("a--b-c", "--", FALSE)

Result:

ab-c

With split_by_each set to FALSE, only the two-character string -- is a delimiter, so b-c stays whole.

Run in a Google Sheet (English US locale) on .

Common errors

  • The first argument should be one cell or one string. Given a range such as A1:A3, SPLIT cuts only the first cell and ignores the rest without any error. Wrap it in ARRAYFORMULA to cut every row.
  • Pieces that look like numbers become numbers, so 007 turns into 7. The zeros are lost in the result.
  • By default every character in delimiter is a separator, so ", " cuts at the comma and at the space. Set split_by_each to FALSE to cut on the whole string only.
  • The result needs free cells to the right. Filled cells there block the output.

Compared with Excel

Excel has no SPLIT function. Its closest match is TEXTSPLIT in Excel 365, or the Text to Columns wizard.

Sources

  1. SPLIT (Docs Editors Help)

Markdown version · All functions