TEXTSPLIT: splitting text into cells with a formula
=TEXTSPLIT(A1,", ") splits the text in A1 wherever there's a comma and a space, and puts each piece in its own cell, going across. Put the separator in the third place to go down instead: =TEXTSPLIT(A1,,", "). TEXTSPLIT is in Excel for Microsoft 365 (Windows and Mac), Excel 2024 and Excel for the web. It isn't in Excel 2021 or older, or in Google Sheets.
TEXTSPLIT at a glance
| You want | Formula | What you get |
|---|---|---|
| Split at a comma, across | =TEXTSPLIT(A1,", ") | Ann, Ben, Cal in three cells side by side |
| Split down a column | =TEXTSPLIT(A1,,";") | Pens, Staples, Folders one under another |
| Rows and columns at once | =TEXTSPLIT(A1,",",";") | A small table, a row per record |
| Split at either of two separators | =TEXTSPLIT(A1,{"-","/"}) | UK-2026/0412 as UK, 2026 and 0412 |
| Skip empty pieces | =TEXTSPLIT(A1,",",,TRUE) | No gap for two commas side by side |
| Numbers you can add up | =SUM(--TEXTSPLIT(A1,",")) | 12,7,30 added up to 49 |
| Just one piece | =INDEX(TEXTSPLIT(A1," "),2) | The second word only |
| No formula, any version | Data › Text to Columns | Plain values, on Windows and Mac |
Each one is worked through below.
Splitting across
B1 holds Ann, Ben, Cal. The pieces are separated by a comma and a space, so that's the separator:
=TEXTSPLIT(B1,", ")
| A | B | C | D | |
|---|---|---|---|---|
| 1 | List | Ann, Ben, Cal | ||
| 2 | Split | Ann | Ben | Cal |
You only type the formula in B2. Excel fills C2 and D2 itself, and if you click C2 the formula shows greyed out in the formula bar. That's a spill: change B1 to Ann, Ben, Cal, Dee and a fourth cell fills in.
With just "," as the separator, Ben and Cal would keep a space at the start, which spoils lookups later. Use TRIM if the spacing varies (see TRIM).
What each part means
Only the first two parts are needed. The rest are for the awkward cases further down this page.
=TEXTSPLIT(text, split across at, split down at, skip empty, ignore case, fill gaps with)
- text: the cell to split, such as
B1. - split across at: the separator that starts a new column, in quotes:
", ". - split down at: the separator that starts a new row. Leave it out to split across only.
- skip empty:
TRUEdrops empty pieces, where two separators sit next to each other. - ignore case:
1makes "and" match "AND" and "And". Leave it out and capitals must match. - fill gaps with: what to show when a row is short of pieces. Without it, the gaps show #N/A.
Splitting down
Leave the 2nd place empty, with two commas, and the pieces go down a column instead of across a row:
=TEXTSPLIT(A2,,";")
| A | B | |
|---|---|---|
| 1 | Order | Items |
| 2 | Pens;Staples;Folders | Pens |
| 3 | Staples | |
| 4 | Folders |
This is handy for a cell that holds a list, such as the items on one order, when you want to count them or look each one up.
Rows and columns at once
Text copied out of another system sometimes arrives in one cell, with a semicolon between records and a comma between fields: Amira,30;Ben,12;Cara,45. Give TEXTSPLIT both separators and it lays the text out as a small table, three rows of two:
=TEXTSPLIT(B1,",",";")
| A | B | C | |
|---|---|---|---|
| 1 | Hours | Amira,30;Ben,12;Cara,45 | |
| 2 | Table | Amira | 30 |
| 3 | Ben | 12 | |
| 4 | Cara | 45 |
The hours sit on the left of their cells because they're text, not numbers. See "Numbers that won't add up" below.
Two separators at once
A reference like UK-2026/0412 uses a dash and a slash. Put both separators in curly brackets, and TEXTSPLIT splits at either one:
=TEXTSPLIT(A2,{"-","/"})
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Reference | Country | Year | Number |
| 2 | UK-2026/0412 | UK | 2026 | 0412 |
| 3 | IE-2025/0098 | IE | 2025 | 0098 |
Empty pieces, short rows and capital letters
Two separators side by side
Pens,,Paper has nothing between the two commas, so TEXTSPLIT gives an empty cell in the middle. Put TRUE in the 4th place to skip it:
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Text | Split | ||
| 2 | Pens,,Paper | Pens | Paper | |
| 3 | Pens,,Paper | Pens | Paper |
#N/A in the gaps
Split Ann,Sales;Ben into rows and columns and Ben has no team, so the cell next to him shows #N/A. The 6th place says what to show instead. Two quotes with nothing between them leave it blank:
=TEXTSPLIT(A1,",",";",,,"")
Separators in capitals
To split Red AND blue and green at the word "and", whatever its capitals, put 1 in the 5th place: =TEXTSPLIT(A1," and ",,,1). That gives Red, blue and green. Without the 1, only the lower-case "and" counts.
Splitting a whole column
This catches most people out. With addresses in A2:A4, =TEXTSPLIT(A2:A4,", ") doesn't give a table. It gives only the first piece of each address, one under another. TEXTSPLIT can't spill both down and across from a list of cells.
There are two ways round it:
- One formula per row. Put
=TEXTSPLIT(A2,", ")in B2 and copy it down. Each copy spills across its own row. This is the one to use most of the time. - Join, then split. TEXTJOIN joins the whole column into one long piece of text with a semicolon between rows, and TEXTSPLIT splits it back out at both separators:
=TEXTSPLIT(TEXTJOIN(";",TRUE,A2:A4),", ",";")
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Address | |||
| 2 | 12 Mill Lane, Leeds, LS6 2AB | 12 Mill Lane | Leeds | LS6 2AB |
| 3 | 4 Rose Court, York, YO1 7HP | 4 Rose Court | York | YO1 7HP |
| 4 | 88 High Street, Hull, HU1 3QP | 88 High Street | Hull | HU1 3QP |
The joined text can't be longer than 32,767 characters, so this works for a few hundred short rows but not for thousands. Pick a joining character that never appears in the data. There's more on TEXTJOIN in combining text.
Just one piece
To get one piece, put TEXTSPLIT inside INDEX. =INDEX(TEXTSPLIT(A2," "),2) gives the second word, so Ella Jane Clarke gives Jane. For the piece before or after the first separator, TEXTBEFORE and TEXTAFTER are shorter: =TEXTBEFORE(A2," ") gives Ella. Splitting first and last names has these for middle names, surnames and initials.
TEXTSPLIT or Text to Columns?
Excel's Text to Columns button does the same job without a formula: select the cells, then Data › Text to Columns, choose Delimited, and tick the separator. It's in the same place in Excel for Mac, and it works in every version of Excel.
- Use TEXTSPLIT when the data will change or be pasted in again next month. The split updates by itself.
- Use Text to Columns for a one-off tidy, in older Excel, or when you want plain values to edit afterwards. It writes over the columns to the right, so leave them empty first.
Without TEXTSPLIT, a formula can still split text with LEFT, MID and FIND. See LEFT, MID and RIGHT.
Common mistakes
Numbers that won't add up
The pieces are text, even when they look like numbers. 12,7,30 split at the commas gives "12", "7" and "30", and =SUM(TEXTSPLIT(A1,",")) gives 0. Put two minus signs in front to turn them into numbers: =SUM(--TEXTSPLIT(A1,",")) gives 12 + 7 + 30 = 49. VALUE does the same: =VALUE(TEXTSPLIT(A1,",")).
#SPILL!
Something is already in the cells the pieces need. Clear them, or move the formula (see #SPILL!).
#NAME?
Your Excel doesn't have TEXTSPLIT, or it's spelt wrongly. Excel 2021 and older show #NAME?. Use Text to Columns, or LEFT and FIND, instead (see the #NAME? error).
A space at the start of each piece
The text has a comma and a space, but the separator is only ",". Use ", ", or if the spacing varies, =TRIM(TEXTSPLIT(A1,",")).
Try it now
B1 lists everyone at a meeting, separated by a comma and a space. In B3, split them into one name per cell, going across.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Attendees | Amira Khan, Ben Lewis, Cara Jones, Dev Patel, Ewa Nowak | ||||
| 2 | ||||||
| 3 | One per cell |
Open this in Try a formula: the same sheet with the answer filled in, to change or share by link.
Part of Excel data cleaning practice: every lesson on the topic, with a project in Excel.
Questions
Why don't I have TEXTSPLIT in Excel?
TEXTSPLIT is in Excel for Microsoft 365 on Windows and Mac, Excel 2024 and Excel for the web. Excel 2021, 2019 and older don't have it, and show #NAME? if you type it. To check your version on a Mac, go to Excel › About Microsoft Excel; on Windows, File › Account. In older Excel, use Data › Text to Columns, or LEFT, MID and FIND.
Can TEXTSPLIT split a whole column at once?
Not directly. Given a range such as A2:A50, it gives only the first piece of each cell. Put =TEXTSPLIT(A2,", ") in the first row and copy it down, so each row spills across. For a short list, =TEXTSPLIT(TEXTJOIN(";",TRUE,A2:A50),", ",";") splits the lot with one formula.
How do I split text into rows instead of columns?
Leave the second part empty and put the separator third: =TEXTSPLIT(A1,,","). The two commas together tell Excel there's no separator for columns, so each piece goes in the next row down. Pens;Staples;Folders split at the semicolons gives three cells, one under another. Give both separators, =TEXTSPLIT(A1,",",";"), and you get rows and columns together, such as a small table of names and hours.
Does Google Sheets have TEXTSPLIT?
No. Google Sheets uses SPLIT, which only splits across: =SPLIT(A1,","). Be careful with a separator of two characters such as ", ". SPLIT treats each character as a separator unless you add FALSE: =SPLIT(A1,", ",FALSE). To split down a column in Google Sheets, wrap it in TRANSPOSE: =TRANSPOSE(SPLIT(A1,",")).