To split a string in Excel, the fastest method is using the TEXTSPLIT function, which allows you to divide a text string into multiple cells based on a specific delimiter (like a comma, space, or semicolon). If you are using an older version of Excel that does not support this function, the Text to Columns feature provides the same result through a manual wizard. Splitting strings is essential for cleaning data, such as separating full names into first and last names, or extracting individual product codes from a combined SKU string.
What You'll Need
- A computer with Microsoft Excel installed.
- A dataset containing strings that follow a consistent pattern (e.g., all items separated by a comma).
- For the
TEXTSPLITfunction, you need a Microsoft 365 subscription or Excel for the Web. - Empty columns to the right of your data to prevent the split text from overwriting existing information.
Step-by-Step
Method 1: Using the TEXTSPLIT Function (Dynamic)
The TEXTSPLIT function is a dynamic array function. This means you enter the formula in one cell, and the results automatically "spill" into the adjacent cells to the right.
- Select the empty cell where you want the first part of the split string to appear.
- Type
=TEXTSPLIT(to begin the function. - Click on the cell containing the text string you want to split (e.g., cell A2). This is the
textargument. - Type a comma to move to the next argument.
- Enter the delimiter you want to split by, enclosed in double quotation marks. For example, if your data is "John,Doe", type
", ". If it is "John Doe", type" ". This is thecol_delimiterargument. - Close the parenthesis
)and press Enter. - Excel will automatically populate the cells to the right with the separated pieces of the string.
- To apply this to an entire column, click the fill handle (the small square at the bottom-right of the cell) and drag it down to the bottom of your list.
Method 2: Using Text to Columns (Static)
If you do not have Microsoft 365, or if you prefer a one-time conversion that doesn't rely on formulas, use the Text to Columns wizard. Note that labels in the ribbon may differ slightly depending on your version of Excel or region.
- Highlight the column or the specific range of cells that contain the strings you want to split.
- Navigate to the Data tab in the top ribbon.
- In the Data Tools group, click the Text to Columns button.
- A wizard window will appear. Select Delimited (this is used when a character like a comma or tab separates your data) and click Next.
- In the Delimiters section, check the box that matches your data. If you have a custom character (like a pipe symbol |), check Other and type the character into the small text box. You will see a preview of the split in the window below. Click Next.
- In the Column data format section, you can choose how the resulting cells should be formatted (General, Text, or Date). Usually, General is sufficient.
- In the Destination field, the default is usually the cell where your original data starts (e.g.,
$A$2). If you leave it as is, Excel will overwrite your original data. To keep the original string, change the destination to an empty column (e.g.,$B$2). - Click Finish.
Method 3: Using LEFT, RIGHT, and FIND (For Older Versions)
When you need a formula but don't have TEXTSPLIT, you can combine these three functions to extract a specific part of a string.
- To extract the first part of a string (everything before the first space), use the formula:
=LEFT(A2, FIND(" ", A2)-1). - The
FINDfunction locates the position of the space, and theLEFTfunction grabs all characters up to that point. - To extract the second part (everything after the first space), use:
=RIGHT(A2, LEN(A2)-FIND(" ", A2)). - The
LENfunction calculates the total length of the string, and subtracting the position of the space tells Excel how many characters to take from the right side.
Common Mistakes
- Overwriting Data: The most common mistake when using Text to Columns is leaving the Destination field as the original cell. This deletes your original combined string. Always select a blank column for the destination.
- Ignoring Extra Spaces: If your delimiter is a comma, but your data looks like "Apple, Orange", splitting by just a comma will leave a leading space in front of "Orange". To fix this, either use
", "(comma and space) as your delimiter or wrap yourTEXTSPLITformula in aTRIMfunction:=TRIM(TEXTSPLIT(A2, ",")). - Incorrect Quote Marks: In Excel formulas, all text strings—including delimiters—must be enclosed in double quotation marks. Writing
=TEXTSPLIT(A2, ,)instead of=TEXTSPLIT(A2, ",")will result in a formula error. - Fixed Width Confusion: In the Text to Columns wizard, users sometimes choose "Fixed Width" instead of "Delimited". Fixed Width is only for data where columns are aligned perfectly by character count, not by a specific symbol.
Tips
- Handling Multiple Delimiters:
TEXTSPLITis powerful because it can handle multiple different delimiters at once. If your data is separated by both commas and semicolons, you can use an array constant:=TEXTSPLIT(A2, {",",";"}). This tells Excel to split the string whenever it encounters either character. - Splitting into Rows: While the second argument of
TEXTSPLITsplits data into columns, the third argument allows you to split data into rows. If you want a list to go down instead of across, leave the second argument empty and put your delimiter in the third:=TEXTSPLIT(A2, , ","). - Using Flash Fill: For very simple splits, you can use Flash Fill (Ctrl+E). Type the first name in the cell next to the full name, type the second first name in the cell below it, and then press
Ctrl + E. Excel will detect the pattern and fill the rest of the column automatically. - Dynamic Updates: Always prefer
TEXTSPLITover Text to Columns if your source data is likely to change. SinceTEXTSPLITis a formula, any change to the original cell will instantly update the split results. Text to Columns is a static action and must be repeated if the data changes.
Troubleshooting
If your split function is not working as expected, try these steps in order:
- Check for #SPILL! Errors: If you see a #SPILL! error when using
TEXTSPLIT, it means there is already data in the cells to the right of your formula. Excel cannot "spill" the results because they would overwrite existing content. Clear the cells to the right and the error will disappear. - Verify the Delimiter: If the text doesn't split at all, you may be using the wrong delimiter. Ensure that a comma is actually a comma and not a semicolon or a special character that looks like a comma. You can test this by using the
=CODE()function on the delimiter character to see its numeric value. - Check for Hidden Characters: Sometimes data imported from the web contains non-breaking spaces (char 160) instead of regular spaces (char 32). If
" "isn't working, try using=SUBSTITUTE(A2, CHAR(160), " ")first to clean the data, then split it. - Formula Errors (#NAME?): If you see #NAME?, it means your version of Excel does not recognize the
TEXTSPLITfunction. You are likely using Excel 2019, 2021, or an older version. Switch to the Text to Columns wizard or the LEFT/RIGHT/FIND method.
Frequently Asked Questions
Can I split a string by a specific number of characters?
Yes, but TEXTSPLIT is for delimiters. To split by a specific number of characters, use the LEFT, MID, and RIGHT functions. For example, =LEFT(A2, 5) will always take the first five characters regardless of spaces or commas.
How do I split a string into only two parts if there are multiple delimiters?
You can use the TEXTBEFORE and TEXTAFTER functions. For example, =TEXTBEFORE(A2, " ") gets everything before the first space, and =TEXTAFTER(A2, " ") gets everything after the first space, even if there are more spaces later in the string.
Does TEXTSPLIT work with dates?
Yes, but be careful. Dates in Excel are stored as numbers. If you split a date string, the result will be text. You may need to wrap the result in a DATEVALUE function to convert it back into a format that Excel recognizes as a date for calculations.
Can I split a string using a word instead of a single character?
Yes. The delimiter in TEXTSPLIT can be a full word. For example, if your string is "Price is 100 dollars" and you want to split it at the word "is", use =TEXTSPLIT(A2, "is").
Is there a way to split strings across multiple sheets?
You cannot split a single string across different worksheets using one function. However, you can use TEXTSPLIT on one sheet and then reference those cells on another sheet using a simple equals formula (e.g., =Sheet1!B2).