Managing inconsistent data strings with varied separators can stall your analytical workflow. While traditional tools like "Text to Columns" offer static fixes, they fail to handle complex, multi-delimiter scenarios dynamically. Modern Excel solutions, specifically the TEXTSPLIT function, revolutionize this process by automatically parsing arrays in real time. Please note: this advanced capability is exclusive to Excel 365 and Excel for the Web. For instance, splitting a string like "John; Doe, Manager" using both commas and semicolons is now seamless. Below, we provide a comprehensive, step-by-step guide to mastering this robust formula for cleaner data organization.
Data cleaning is one of the most common tasks performed in Microsoft Excel. Frequently, you will import data from external systems, databases, or text files where multiple pieces of information are squeezed into a single cell. While splitting text separated by a single delimiter (like a comma or a space) is straightforward, things get tricky when your data contains multiple, inconsistent delimiters-such as a mix of commas, semicolons, spaces, and hyphens.
For example, how do you clean a string like "Apple, Orange; Banana - Grape" into individual cells? Fortunately, Excel offers several powerful formulas and tools to tackle this challenge. In this comprehensive guide, we will explore the best ways to split text with multiple delimiters, ranging from modern dynamic array formulas to classic legacy workarounds.
TEXTSPLIT FunctionIf you are using Excel 365 or Excel 2021 (and newer), you have access to a game-changing text manipulation function: TEXTSPLIT. This function is specifically designed to split text strings across columns or rows using one or more delimiters.
=TEXTSPLIT(text, col_delimiter, [row_delimiter], [ignore_empty], [match_mode], [pad_with])
To split text by multiple delimiters using TEXTSPLIT, you can pass an array constant as the col_delimiter argument. An array constant in Excel is enclosed in curly braces {}, with individual delimiters separated by commas inside.
Suppose cell A2 contains the following text string:
"John,Smith;Chicago-IL USA"
This string uses four different delimiters: a comma (,), a semicolon (;), a hyphen (-), and a space ( ). To split this string into individual columns, enter the following formula in cell B2:
=TEXTSPLIT(A2, {",", ";", "-", " "})
How it works: Excel evaluates the list of delimiters inside the curly braces and splits the text whenever it encounters any of those characters. Because TEXTSPLIT is a dynamic array function, the results will automatically "spill" into adjacent columns to the right.
What happens if your text contains consecutive delimiters, such as a comma followed by a space (e.g., "Apple, Orange")? By default, splitting by both "," and " " will create an empty cell in between them. To prevent this, you can use the ignore_empty argument of TEXTSPLIT by setting it to TRUE:
=TEXTSPLIT(A2, {",", ";", "-", " "}, , TRUE)
This tells Excel to ignore any empty substrings created during the splitting process, keeping your final dataset neat and compact.
SUBSTITUTE and Text to ColumnsIf you are using an older version of Excel (such as Excel 2019, 2016, or 2013), the TEXTSPLIT function is not available. To achieve the same result without upgrading, you can use a clever workaround: standardize your delimiters first, then split them.
The strategy is to use the SUBSTITUTE function to replace all your varied delimiters with a single, unique character (like a vertical bar or pipe symbol: |). Once normalized, you can easily split the text using Excel's built-in "Text to Columns" wizard.
Assume your mixed-;
is in cell A2. In cell B2, enter a nested SUBSTITUTE formula to replace semicolons, hyphens, and spaces with a pipe symbol:
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2, ";", "|"), "-", "|"), " ", "|")
This formula works from the inside out:
"|"."|"."|".The result in cell B2 will look like this: "John|Smith|Chicago|IL|USA".
|) in the;
box.FILTERXML (Excel 2013 - 2019)If you are running Excel 2013 through Excel 2019 on Windows and want a pure formula-based solution that dynamically splits;
without manual steps, you can use the highly versatile FILTERXML function.
This method converts your delimited string into a standard XML structure, which Excel can then query and parse automatically.
To extract the N-th item from a string in cell A2 with multiple delimiters (comma, semicolon, hyphen), use this formula:
=FILTERXML("<t><s>" & SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2, ",", "</s><s>"), ";", "</s><s>"), "-", "</s><s>") & "</s></t>", "//s[" & COLUMN(A1) & "]")
SUBSTITUTE functions replace your delimiters (,, ;, and -) with XML closing and opening tags: </s><s>."<t><s>" and appending "</s></t>", the raw string "Apple,Orange-Banana" becomes a valid XML document: <t><s>Apple</s><s>Orange</s><s>Banana</s></t>FILTERXML function evaluates this string using the XPath expression "//s[1]", which retrieves the first item. Dragging the formula to the right changes COLUMN(A1) to COLUMN(B1), which evaluates to "//s[2]", pulling the second item, and so on.Note: FILTERXML is only available in Excel for Windows and does not work in Excel for Mac or Excel on the Web.
For large datasets or recurring data-import processes, using formulas can slow down your workbook. Power Query is Excel's built-in ETL (Extract, Transform, Load) tool that handles multiple delimiters beautifully and can be refreshed with a single click.
Splitter.SplitTextByAnyDelimiter M function.For example, change the generated step formula to look like this:
= Table.SplitColumn(Source, "Column1", Splitter.SplitTextByAnyDelimiter({",", ";", "-", " "}, QuoteStyle.Csv))
Once applied, click Close & Load on the Home tab to return the clean, split data back to your Excel worksheet.
The best method to split text with multiple delimiters in Excel depends entirely on your version of Excel and your personal workflow preferences:
| Method | Excel Version Compatibility | Pros | Cons |
|---|---|---|---|
TEXTSPLIT |
Excel 365, Excel 2021+ | Incredibly easy, dynamic, native array spilling. | Not backward compatible. |
Nested SUBSTITUTE + Text to Columns |
All Versions | Works on any Excel version without advanced setup. | Requires manual formatting steps; non-dynamic. |
FILTERXML Hack |
Excel 2013 - 2019 (Windows) | Dynamic formula solution for older Excel versions. | Complex syntax; not supported on Mac or Web. |
| Power Query | Excel 2010+ (via Add-in) / 2016+ (Native) | Best for heavy datasets; easy to refresh. | Requires learning a slightly different interface. |
By mastering these techniques, you will drastically cut down the time spent cleaning raw data, allowing you to focus on analyzing it and drawing valuable insights.
Disclaimer:
The documents and templates provided on this page are for informational and illustrative purposes only. They do not constitute professional, legal, or financial advice, and should not be relied upon as such. Because individual circumstances and regulatory requirements vary, these materials may not be suitable for your specific needs. We recommend consulting with a qualified professional before adapting or using any of these examples for official or commercial purposes.