Text Conversion in Excel: How to Split and Format Data
In this article
Text conversion in Excel is the process of changing how data is stored or displayed within a cell, most commonly used to split a single column of combined text (like "First Name Last Name") into multiple separate columns. This is primarily achieved using the "Text to Columns" wizard or specific text functions like LEFT, RIGHT, and MID. By converting text, you can transform raw, unorganized data into a structured format that allows for better sorting, filtering, and analysis.
What You'll Need
- A computer with Microsoft Excel installed (Windows or macOS).
- A dataset containing text that needs to be split or reformatted.
- Empty columns to the right of your data to prevent existing information from being overwritten.
Step-by-Step
Depending on your goal, you can convert text using the built-in wizard for one-time cleaning or formulas for dynamic updates. Note that menu labels may differ slightly depending on your version of Excel or regional settings.
Method 1: Using the Text to Columns Wizard
- Prepare your workspace: Select the column containing the text you want to convert. Ensure there are several empty columns to the right of your selection. If there is data in the adjacent columns, Excel will overwrite it with the converted text.
- Open the tool: Navigate to the Data tab on the top ribbon. In the Data Tools group, click on Text to Columns.
- Choose the file type: A wizard window will appear. You will see two options: "Delimited" and "Fixed width".
- Delimited: Choose this if your data is separated by a specific character, such as a comma, tab, semicolon, or space. This is the most common choice for CSV files or name lists.
- Fixed width: Choose this if your data is aligned in columns with spaces between each field, and each field is always the same number of characters.
- Set the delimiters: If you chose "Delimited", check the boxes for the characters that separate your data. For example, if your data is "John, Doe", check the Comma box. You will see a Data preview window at the bottom showing how the columns will be split. Click Next.
- Format the columns: In the final step, you can specify the data format for each new column. Click on a column in the preview window and choose General, Text, or Date. Choosing "Text" is recommended for numbers that start with zeros (like zip codes) to prevent Excel from removing the leading zero.
- Set the destination: By default, Excel places the converted data starting in the cell you originally selected. If you want to keep the original column intact, change the Destination field to a different cell (e.g., $B$1).
- Finish: Click Finish. Your text is now converted into separate columns.
Method 2: Using Text Functions (Dynamic Conversion)
- Identify the pattern: Determine if the text you want to extract is always at the start, the end, or in the middle of the cell.
- Extract the start of the text: Use the
=LEFT(text, [num_chars])formula. For example, if cell A2 contains "Product-123" and you only want the word "Product", enter=LEFT(A2, 7). - Extract the end of the text: Use the
=RIGHT(text, [num_chars])formula. To get the "123" from "Product-123", enter=RIGHT(A2, 3). - Extract from the middle: Use the
=MID(text, start_num, num_chars)formula. If you have a string like "ID: 99-ABC" and you want the "99", enter=MID(A2, 5, 2), which tells Excel to start at the 5th character and take 2 characters. - Apply to all: Click the bottom-right corner of the cell containing the formula and drag it down to apply the conversion to the rest of your list.
Common Mistakes
One of the most frequent errors is failing to insert blank columns before using the Text to Columns tool. Because Excel pushes data to the right, any existing data in those cells will be permanently deleted without a warning prompt. Always insert 3-4 empty columns to be safe.
Another common mistake is ignoring the "Data Format" step in the wizard. Users often leave columns as "General," which causes Excel to automatically convert long strings of numbers into scientific notation (e.g., 1.23E+11) or strip leading zeros from phone numbers and postal codes. Always explicitly select "Text" for identifiers that should not be treated as mathematical values.
Using the Text to Columns tool on a dataset that is linked to other formulas can also cause issues. Since the tool physically moves data into new cells, any formulas referencing the original cell may no longer point to the correct piece of information.
Tips
For those using modern versions of Excel, try Flash Fill. Instead of using the wizard, simply type the desired result in the cell next to your data for the first two rows. For example, if A1 is "John Doe" and A2 is "Jane Smith", type "John" in B1 and "Jane" in B2. Excel will often recognize the pattern and suggest a grayed-out list of the remaining names. Press Enter to accept the suggestion and fill the entire column instantly.
When dealing with inconsistent delimiters (e.g., some rows use commas and some use semicolons), you can check multiple delimiter boxes in the Text to Columns wizard simultaneously. Excel will treat any of the selected characters as a trigger to start a new column.
If you are using formulas for conversion, wrap your formulas in the TRIM() function. This removes any accidental leading or trailing spaces that often occur during data exports, ensuring your converted text is clean and searchable.
Troubleshooting
The data didn't split into columns: Check your delimiter selection. If your data is separated by a space but you selected "Comma," Excel will not find any match and will keep the text in one cell. Go back to the second step of the wizard and ensure the correct delimiter is checked.
Numbers changed to weird symbols: This happens when a number is too long for the "General" format. To fix this, undo the action (Ctrl+Z), run the Text to Columns wizard again, and in the final step, select the column and change the format to "Text".
The Flash Fill suggestion is wrong: Flash Fill relies on pattern recognition. If it is guessing incorrectly, provide more examples. Instead of two rows, manually type the converted text for five or six rows. This gives Excel a stronger pattern to follow. If it still fails, revert to the Text to Columns wizard for more precision.
The formula returns an error: Ensure your cell references are correct. If you are using =MID() or =LEFT(), verify that the number of characters you are requesting does not exceed the length of the string, and ensure there are no hidden characters (like non-breaking spaces) in your source data.
Frequently Asked Questions
Can I convert text back into a single cell?
Yes. You can use the =CONCAT() or =TEXTJOIN() functions to merge multiple columns back into one. TEXTJOIN is preferred because it allows you to specify a delimiter (like a space or comma) between the merged cells.
Does Text to Columns work on a whole table at once?
No, Text to Columns only works on one selected column at a time. If you have multiple columns that need splitting, you must repeat the process for each column individually.
Will this process change my original data?
If you leave the "Destination" as the original cell, yes, the original data will be replaced. To preserve your original data, change the destination cell to an empty column during the final step of the wizard.
What is the difference between Delimited and Fixed Width?
Delimited looks for a specific character (like a comma) to know where to split. Fixed Width splits the text at a specific character count (e.g., every 10 characters), regardless of what the characters are.
Can I use this to separate dates from times?
Yes. If your cell contains "2023-10-01 12:00", you can use the Text to Columns wizard with a "Space" delimiter to split the date into one column and the time into another.