Need to break Widget-West-2026 into separate cells? In Excel 365 the TEXTSPLIT function does it in one formula that spills across columns; in older versions you combine LEFT/MID/FIND or use Text to Columns.
The example
Codes that pack three fields into one cell, split on the hyphen.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Code | Part 1 | Part 2 | Part 3 |
| 2 | Widget-West-2026 | Widget | West | 2026 |
| 3 | Gadget-East-2025 | Gadget | East | 2025 |
The formula
Entered once in B2, the pieces spill across B:D:
How it works
TEXTSPLIT cuts the string wherever it finds the delimiter:
- The first argument is the text to split (
A2). - The second is the column delimiter —
"-"here. Each piece between hyphens becomes its own cell. - The result spills to the right automatically; you enter the formula in one cell only.
- Pass an array of delimiters like
{"-"," "}to split on several characters at once.
Try it: interactive demo
Enter text and a delimiter; see TEXTSPLIT’s pieces.
Variations
Just the first or last piece
TEXTBEFORE / TEXTAFTER grab one side without spilling:
Legacy: first piece with LEFT + FIND
Any version — everything up to the first hyphen:
No formula: Text to Columns
Select the column, Data → Text to Columns → Delimited → choose the delimiter. Best for a one-time split.
Pitfalls & errors
TEXTSPLIT needs Excel 365. Excel 2021 and older show #NAME?. Use TEXTBEFORE/TEXTAFTER (also 365), LEFT/MID/FIND, or Text to Columns.
#SPILL! The pieces need empty cells to land in. Clear the cells to the right of the formula.
Missing delimiters create blanks. Set the fourth argument ignore_empty to TRUE to skip empty results from consecutive delimiters: =TEXTSPLIT(A2,"-",,TRUE).
Practice workbook
Frequently asked questions
How do I split text into columns with a formula?
How do I get just the part before or after a character?
Does TEXTSPLIT work in Excel 2021?
Stop fighting formulas. Learn them in a day.
This recipe is one of hundreds of real-world formulas we teach. Our Excel Formulas & Functions class covers lookups, logic, text, and dynamic arrays hands-on — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.
See the Formulas & Functions Class