Skip to content

TEXTSPLIT

Splits text into separate cells across columns or down rows, wherever a delimiter appears. The result spills.

Syntax

=TEXTSPLIT(, , , , , )

Text

Excel for Microsoft 365, Excel 2024 and later, and Excel for the web. Not available in Excel 2021 or earlier.

Try it

Edit the formula in B2 or change the inputs. The sheet recalculates as you type.

B2
A
B
C
D
E
1
Record
Name
Team
Office
2
Dana,Finance,Sydney
Dana
Finance
Sydney
3
4

B2 =TEXTSPLIT(A2,",") returns Dana, Finance, Sydney

How TEXTSPLIT works

TEXTSPLIT splits text at a delimiter and spills the pieces into neighbouring cells. It does in one formula what the Text to Columns wizard does by hand, and the result updates when the source text changes. It is the opposite of TEXTJOIN.

The arguments

  • text is the text to split.
  • col_delimiter says where to start a new column. =TEXTSPLIT("Dana,Finance,Sydney",",") returns three cells across: Dana, Finance, Sydney.
  • row_delimiter says where to start a new row. =TEXTSPLIT("a,1;b,2",",",";") returns a table with two rows and two columns.
  • ignore_empty controls what happens when two delimiters touch. By default an empty cell is kept, so "a,,c" gives a, an empty cell and c. With TRUE it gives a and c.
  • match_mode switches between case-sensitive (0) and case-insensitive (1) matching of the delimiter.
  • pad_with fills gaps in uneven rows. Without it, short rows end in #N/A.

Splitting down instead of across

To get the pieces in a column, leave the column delimiter empty and give the row delimiter: =TEXTSPLIT(A2,,","). The two commas are not a typo; the empty argument is the column delimiter.

Several delimiters

Use an array constant to split at more than one: =TEXTSPLIT(A2,{",",";"}) splits at commas and semicolons. If one delimiter should be a multi-character string, such as " - ", put it in the list as it is.

The result is text, and it spills

Every piece is text, even if it looks like a number. "1,250" split at a comma gives "1" and "250". To get numbers, wrap the formula in VALUE, which accepts the array: =VALUE(TEXTSPLIT(A2,",")).

The result spills into as many cells as it needs. If a cell in the way isn't empty, Excel shows #SPILL!, so clear the range. Don't expect to type over part of a spilled result; edit the formula in its first cell.

Picking one piece

To use just one piece of the split, wrap it in INDEX. =INDEX(TEXTSPLIT(A2,","),2) returns the second item. For the text before or after one delimiter, TEXTBEFORE and TEXTAFTER are shorter.

Trimming the pieces

TEXTSPLIT does not trim spaces. Splitting "red, green" at a comma leaves a leading space on the second piece. Either split at ", " or wrap the result in TRIM: =TRIM(TEXTSPLIT(A2,",")).

Before TEXTSPLIT

In Excel 2021 and earlier, splitting needs Text to Columns, which gives a one-off result that does not update, or long LEFT, MID and FIND formulas. TEXTSPLIT is only in Microsoft 365, Excel 2024 and later, and Excel for the web.

Arguments

text
The text to split. Usually a cell such as A2.
col_delimiter
The text that marks where to split into columns, such as ",". Pass an array constant such as {",",";"} to split at several delimiters. Leave it empty, as in TEXTSPLIT(A2,,","), to split only into rows.
row_delimiteroptional
The text that marks where to start a new row. If you leave it out, the result is a single row.
ignore_emptyoptional
FALSE, the default, keeps an empty piece where two delimiters sit side by side. TRUE skips them.
match_modeoptional
0, the default, is case-sensitive. 1 ignores case when matching delimiters.
pad_withoptional
What to put in the gaps when rows have different numbers of pieces. The default is #N/A.

Examples

Each example is a live sheet. Change the inputs or the formula and watch the result.

Example 1

Split text into columns

B2 =TEXTSPLIT(A2,",")

Result: Dana, Finance, Sydney

The three pieces spill into B2:D2. If any of those cells held something, the formula would show #SPILL!.

B2
A
B
C
D
E
1
Record
Name
Team
Office
2
Dana,Finance,Sydney
Dana
Finance
Sydney
3
4

B2 =TEXTSPLIT(A2,",") returns Dana, Finance, Sydney

Example 2

Split into rows and columns at once

B2 =TEXTSPLIT(A2,",",";")

Result: Pallet wrap, 38; Gloves, 120; Tape, 64

The comma starts a new column and the semicolon starts a new row. The quantities arrive as text, so wrap them in VALUE if you need numbers.

B2
A
B
C
D
1
Order lines
Item
Qty
2
Pallet wrap,38;Gloves,120;Tape,64
Pallet wrap
38
3
Gloves
120
4
Tape
64
5
6

B2 =TEXTSPLIT(A2,",",";") returns Pallet wrap, 38; Gloves, 120; Tape, 64

Example 3

Skip empty pieces

B2 =TEXTSPLIT(A2,",",,TRUE)

Result: red, blue

Without the TRUE, the result would be red, an empty cell and blue. The empty argument keeps the position for row_delimiter.

B2
A
B
C
D
1
Raw tags
Tag 1
Tag 2
2
red,,blue
red
blue
3
4

B2 =TEXTSPLIT(A2,",",,TRUE) returns red, blue

Example 4

Pad short rows instead of showing #N/A

B2 =TEXTSPLIT(A2,",",";",,,"-")

Result: a, 1, x; b, 2, -

The second row has only two pieces. pad_with fills the gap with a dash. Without it, the gap would show #N/A.

B2
A
B
C
D
E
1
Records
Col 1
Col 2
Col 3
2
a,1,x;b,2
a
1
x
3
b
2
-
4
5

B2 =TEXTSPLIT(A2,",",";",,,"-") returns a, 1, x; b, 2, -

Example 5

Pick one piece with INDEX

B2 =INDEX(TEXTSPLIT(A2,","),2)

Result: wrap

INDEX picks the second piece from the split. Only one cell is needed, so nothing spills.

B2
A
B
C
1
Tags
Second tag
2
gloves,wrap,tape
wrap
3
4

B2 =INDEX(TEXTSPLIT(A2,","),2) returns wrap

Your turn.

Solve it in the sheet. Every answer is checked, with hints if you need them.

Task 1 of 2

In B2, split the record in A2 at the commas so each piece goes in its own column.

Answer in B2.

B2
A
B
C
D
E
F
1
Record
Name
Team
Office
2
Dana,Finance,Sydney
3
4
5
6
gloves,wrap,tape,labels
7
Second tag
8

Common mistakes

  • The result spills. If any cell in the output range holds something, you get #SPILL!. Clear the cells, or move the formula.
  • Every piece is text. "1,250" split at a comma gives "1" and "250". Wrap the formula in VALUE when you need numbers.
  • Pieces keep their spaces. Splitting "red, green" at a comma gives " green" with a leading space. Split at ", " or wrap the result in TRIM.
  • Two delimiters side by side create an empty piece unless ignore_empty is TRUE.
  • Short rows end in #N/A. Set pad_with to a value such as "" or "-" to fill them.
  • TEXTSPLIT is not in Excel 2021 or earlier. There the formula shows #NAME?. Text to Columns is the older, manual alternative.

Questions people ask

How do I split text into separate cells with a formula?

Use `=TEXTSPLIT(A2,",")`, with your delimiter in quotes. The pieces spill into the cells to the right. For rows, add a row delimiter as the third argument.

How do I split text into rows instead of columns?

Leave the column delimiter empty and give the delimiter as the third argument: `=TEXTSPLIT(A2,,",")`. The pieces then spill downwards.

How do I split at more than one delimiter?

Give the delimiters as an array constant: `=TEXTSPLIT(A2,{",",";"})`. The text is split wherever any of them appears.

Why does TEXTSPLIT return #SPILL!?

Something is in the way of the output range. Clear those cells. Merged cells and Excel tables also block spills.

What is the difference between TEXTSPLIT and Text to Columns?

Text to Columns is a one-off wizard, and its result does not update. TEXTSPLIT is a formula, so it recalculates when the source text changes.

Learn TEXTSPLIT in a real sheet.

TEXTSPLIT is taught in Logic and text, lesson 14: TEXTSPLIT. Each lesson is a short, graded exercise like the one above.