How to Use Excel Delimiter Formula
In this article
Yes, you can split text into separate columns using a formula. In modern versions of Excel (Microsoft 365 or Excel 2021+), the TEXTSPLIT function is the primary tool for this. It takes a cell with a string of text and a delimiter (like a comma or space) to separate the items into multiple columns. The latest desktop and web versions of Excel support TEXTSPLIT natively, while older versions may use the Flash Fill feature instead.
What You'll Need
- A spreadsheet application that supports the TEXTSPLIT function (Microsoft 365, Excel 2021, or Excel on the web).
- A dataset containing the text you wish to split. This data should be in a single column, with the items separated by a consistent delimiter (e.g., a comma, pipe symbol, or space).
- A basic understanding of Excel cell references (like A1) and how to enter a formula into a cell.
Step-by-Step
- Open your spreadsheet and navigate to the worksheet containing the data you want to split. Ensure the column you want to process is clean and has a header row if applicable.
- Identify your data source and delimiter. Click on a cell adjacent to your data or in an empty area of the sheet. You will use the TEXTSPLIT function to generate the split data. For example, if your data is in cell A2 and it is a list of names separated by a comma followed by a space (", "), that is your delimiter.
- Enter the TEXTSPLIT function. Click the first cell where you want the first item of the split to appear (e.g., cell B2). Type the following formula:
=TEXTSPLIT(A2, ", "). This formula tells Excel to take the text from A2 and split it wherever it finds a comma and a space. - Drag the formula down. With the formula entered in B2, click the fill handle (the small square at the bottom-right corner of the cell) and drag it down the column to apply the formula to the rest of your rows. Excel will automatically adjust the cell reference for each row (so A3, A4, etc.), splitting the data in each corresponding row.
- Handle multiple delimiters. If your text contains different separators, you can list them all inside the function. For instance, if a cell contains names separated by either a comma and a space or a slash ("/"), you can use the formula:
=TEXTSPLIT(A2, {", ", "/"}). The curly braces{}indicate an array of delimiters. - Control column direction. By default, TEXTSPLIT spills the results horizontally (to the right). To force it to split vertically (downwards), include an optional fourth argument set to
TRUE. The formula becomes=TEXTSPLIT(A2, ", ", , TRUE). This is useful if you want to place the split data in a column next to your original data. - Handle missing or empty delimiters. If your data might have consecutive delimiters (e.g., a comma followed immediately by another comma), TEXTSPLIT will create an empty cell in the result. To replace these empty cells with a specific value (like a dash "-" or a zero 0), use the optional fifth argument. For example:
=TEXTSPLIT(A2, ", ", , , "-").
Common Mistakes
- Using an unsupported delimiter. The TEXTSPLIT function does not accept a range of cells as a delimiter argument. You must type the delimiter as a text string (e.g.,
",") or an array constant (e.g.,{",", "|"}). Do not select a range of cells likeA1:A3as the delimiter. - Ignoring the comma and space. A common error is using just a comma as the delimiter (
","). This will split the string but leave the space behind, often creating awkward spacing in the result. Always include the space character in your delimiter string if your data uses a comma-separated list with spaces. - Forgetting to enable dynamic arrays. The TEXTSPLIT function is a dynamic array formula. If your Excel version is older than 2021 or 365, this function will not work. In those cases, you must use Flash Fill instead. To use Flash Fill, type the first desired result manually (e.g., the first name from a list), then start typing the second result. Excel will often detect the pattern and fill in the rest.
- Not accounting for line breaks. If your data is in a single cell but contains line breaks (e.g., from copying and pasting from a web page), you cannot simply use
","as the delimiter. You must replace the line break character in your formula. You can do this by using theCHAR(10)function. For example, to split by line break, use=TEXTSPLIT(A2, CHAR(10)).
Tips
- Use the Formula Builder. For complex formulas, use the Formula Builder. Click on the cell with your formula, then go to the Formulas tab on the ribbon and click Insert Function. Select TEXTSPLIT from the list and a dialog box will appear, guiding you through each argument. This is a great way to ensure you have the correct syntax for your delimiter and optional arguments.
- Check for merged cells. If your formula is not spilling correctly, check if the cells are merged. Merged cells can prevent dynamic array formulas from calculating and displaying their results properly. Unmerge any cells in the path where the formula is trying to spill.
- Be mindful of data cleaning. Before applying the formula, clean your data. Remove any inconsistent formatting, such as extra spaces at the beginning or end of the text. Use the TRIM function (
=TRIM(A2)) to clean up text that has leading or trailing spaces. This ensures your delimiter works consistently across all rows. - Use the spill range. When you use TEXTSPLIT, Excel automatically highlights the spilled range of cells with a blue outline. This visual cue indicates the extent of the data. If you need to move or delete the data, always select the entire spilled range by clicking the blue outline, rather than selecting individual cells.
Troubleshooting
- Formula returns a
#SPILL!error. This error occurs when Excel cannot display the results of the formula because there is existing data in the destination range where the formula wants to spill. The solution is to clear the existing data or move the formula to a different location. If the formula is trying to spill into a merged cell, unmerge those cells. - No results are displayed. If you enter the formula but the cell remains empty, check that your delimiter is correct. Make sure you are using a text string and not a cell reference for the delimiter. Also, verify that your data actually contains the delimiter you specified. If the delimiter is not found, TEXTSPLIT will return an empty result.
- Formula returns
#NAME?error. This error indicates that Excel does not recognize the function name. This usually happens if you are using an older version of Excel that does not support the TEXTSPLIT function. To fix this, upgrade to Microsoft 365 or Excel 2021, or use Flash Fill as an alternative method. - Text is not splitting correctly. If the split is not where you expect it, check for hidden characters or formatting issues. For example, if your delimiter is a comma but the text is actually separated by a different character (like a semicolon), the split will fail. You can use the Find and Replace feature (Ctrl+H) to replace the incorrect delimiter with the correct one before applying the formula.
Frequently Asked Questions
What is the Excel delimiter formula?
The Excel delimiter formula is a function that divides text into separate columns based on a specified character or string. In modern Excel, this is primarily the TEXTSPLIT function, which automatically expands across multiple cells to display the result.
How do I split text by space in Excel?
To split text by a single space, you can use the formula =TEXTSPLIT(A2, " "). This will separate the text into as many columns as there are words. If you need to split by multiple spaces (like double spaces between words), you must use the TRIM function first to clean the data: =TEXTSPLIT(TRIM(A2), " ").
Can I split text by multiple delimiters at once?
Yes, you can split text by multiple delimiters simultaneously. For example, to split a string by commas, spaces, or pipes, you can use the formula =TEXTSPLIT(A2, {", ", "|", " "}). The curly braces {} create an array of delimiters that Excel will use.
How do I split a column into two separate columns?
To split a single column into two separate columns, you can use the Text to Columns feature (Data tab > Text to Columns). This tool is more manual than TEXTSPLIT but works in all versions of Excel. Alternatively, if you have a modern version, use =TEXTSPLIT(A2, ",") and drag the result to the right.
What does the #CALC! error mean in TEXTSPLIT?
The #CALC! error in TEXTSPLIT means that the function is trying to divide by zero. This typically happens if you try to use the TEXTSPLIT function on an empty cell or if you are using a delimiter that results in an infinite loop of empty splits. Ensure your data is not empty and that your delimiter is a valid string.