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 =TEXTSPLIT(A2,",") returns Dana, Finance, Sydney
Splits text into separate cells across columns or down rows, wherever a delimiter appears. The result spills.
Syntax
=TEXTSPLIT(, , , , , )
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 =TEXTSPLIT(A2,",") returns Dana, Finance, Sydney
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.
=TEXTSPLIT("Dana,Finance,Sydney",",") returns three cells across: Dana, Finance, Sydney.=TEXTSPLIT("a,1;b,2",",",";") returns a table with two rows and two columns."a,,c" gives a, an empty cell and c. With TRUE it gives a and c.#N/A.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.
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.
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.
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.
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,",")).
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.
A2.",". Pass an array constant such as {",",";"} to split at several delimiters. Leave it empty, as in TEXTSPLIT(A2,,","), to split only into rows.FALSE, the default, keeps an empty piece where two delimiters sit side by side. TRUE skips them.0, the default, is case-sensitive. 1 ignores case when matching delimiters.#N/A.Each example is a live sheet. Change the inputs or the formula and watch the result.
Example 1
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 =TEXTSPLIT(A2,",") returns Dana, Finance, Sydney
Example 2
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 =TEXTSPLIT(A2,",",";") returns Pallet wrap, 38; Gloves, 120; Tape, 64
Example 3
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 =TEXTSPLIT(A2,",",,TRUE) returns red, blue
Example 4
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 =TEXTSPLIT(A2,",",";",,,"-") returns a, 1, x; b, 2, -
Example 5
B2 =INDEX(TEXTSPLIT(A2,","),2)
Result: wrap
INDEX picks the second piece from the split. Only one cell is needed, so nothing spills.
B2 =INDEX(TEXTSPLIT(A2,","),2) returns wrap
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.
#SPILL!. Clear the cells, or move the formula."1,250" split at a comma gives "1" and "250". Wrap the formula in VALUE when you need numbers.", " or wrap the result in TRIM.#N/A. Set pad_with to a value such as "" or "-" to fill them.#NAME?. Text to Columns is the older, manual alternative.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.
Leave the column delimiter empty and give the delimiter as the third argument: `=TEXTSPLIT(A2,,",")`. The pieces then spill downwards.
Give the delimiters as an array constant: `=TEXTSPLIT(A2,{",",";"})`. The text is split wherever any of them appears.
Something is in the way of the output range. Clear those cells. Merged cells and Excel tables also block spills.
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.
TEXTSPLIT is taught in Logic and text, lesson 14: TEXTSPLIT. Each lesson is a short, graded exercise like the one above.