Text function

TEXTSPLIT function

Splits text into separate cells at the delimiters you choose, across columns, down rows, or both. The result spills.

Available in Microsoft 365, Excel 2024, Excel for the web

Excel 2024 and laterNot in Google Sheets

Syntax

TEXTSPLIT(text, col_delimiter, [row_delimiter], [ignore_empty], [match_mode], [pad_with])
ArgumentWhat it means
textRequiredThe text or cell to split.
col_delimiterRequiredWhere to start a new column, e.g. ",". Can be an array like {",",";"}. Leave empty to split only into rows.
row_delimiterOptionalWhere to start a new row.
ignore_emptyOptionalTRUE skips empty pieces created by consecutive delimiters. Default FALSE.
match_modeOptional0 (default) case-sensitive; 1 ignore case.
pad_withOptionalValue used to fill gaps when rows have different numbers of pieces. Default #N/A.

Returns: A spilled array of text pieces.

How TEXTSPLIT works

TEXTSPLIT is the formula version of Data > Text to Columns, but better: it updates automatically, can split into rows as well as columns, and accepts several delimiters at once. Give it "Pens, Paper, Ink" and a ", " delimiter and it spills three cells: Pens, Paper, Ink.

With a row_delimiter it can turn a whole packed record into a small table, e.g. "Ana=82;Ben=91" becomes two rows and two columns. Pass an array constant such as {",",";"} to treat several characters as delimiters, and set ignore_empty to TRUE so double delimiters do not produce blank cells. When some rows have fewer pieces than others, the gaps are filled with #N/A unless you set pad_with, e.g. to "".

All pieces are returned as text, even digits. Put -- in front (=--TEXTSPLIT(...)) or wrap in VALUE to turn them into numbers. The spill range needs empty cells; otherwise you get #SPILL!.

Examples

1Split a list across columns

B2fx=TEXTSPLIT(A2,", ")
ABCD
1Order items
2Pens, Paper, InkPensPaperInk

Each comma-and-space starts a new column, so the three items spill into B2:D2.

2Split down a column instead

B2fx=TEXTSPLIT(A2,,", ")
AB
1Order items
2Pens, Paper, InkPens
3Paper
4Ink

Leaving col_delimiter empty and using the separator as row_delimiter spills the items vertically.

3Unpack name=score pairs into a table

B2fx=TEXTSPLIT(A2,"=",";")
ABC
1Scores (packed)
2Ana=82;Ben=91;Chen=77Ana82
3Ben91
4Chen77

; starts a new row and = a new column, giving a 3 × 2 table. The scores are text; use --TEXTSPLIT(...) if you want numbers.

4Several delimiters and empty pieces

B2fx=TEXTSPLIT(A2,{",",";"},,TRUE)
ABCD
1Colours
2red,blue;;greenredbluegreen

Both , and ; split the text. The double ;; would create an empty cell, but ignore_empty TRUE removes it.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 17 KB

Common errors and how to fix them

ErrorWhy it happensFix
#SPILL!Cells in the spill area are not empty.Clear the cells to the right/below, or move the formula.
#N/AShown inside the result where a row has fewer pieces than the longest row.Set pad_with, e.g. "".
#NAME?Not available in Excel 2021 or older.Use Data > Text to Columns or MID/FIND formulas.

Tips

  • TEXTSPLIT works on one cell. To split a whole column, either split each row separately or join the column first: =TEXTSPLIT(TEXTJOIN(";",TRUE,A2:A10),",",";").
  • Wrap with TRIM to remove stray spaces around pieces: =TRIM(TEXTSPLIT(A2,",")).
  • Use INDEX to grab just one piece: =INDEX(TEXTSPLIT(A2,"-"),2) returns the second part.

Questions

How do I split text into rows instead of columns?

Leave the second argument empty and put the delimiter in the third: =TEXTSPLIT(A2,,",").

Why are the numbers from TEXTSPLIT not adding up?

TEXTSPLIT returns text. Use =--TEXTSPLIT(A2,",") or VALUE to convert them.

Can TEXTSPLIT split a whole column at once?

Not directly - a single call handles one text. Join the column with TEXTJOIN first, or use BYROW/REDUCE with VSTACK in Microsoft 365.

Google Sheets

Use SPLIT(text, delimiter), which splits into columns; for rows as well, combine SPLIT with TRANSPOSE or FLATTEN.

TEXTSPLIT in other languages

In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.

LanguageFunction name
CzechROZDĚLIT.TEXT
DanishTEKSTSPLIT
Portuguese (Portugal)DIVIDIRTEXTO
SwedishDELATEXT
TurkishMETİNBÖL

Recipes that use TEXTSPLIT