Splitting Text Using TEXTSPLIT and Standardizing Data in Excel
Course: Advanced Excel
Topic: Splitting Text Using TEXTSPLIT and Standardizing Data
Course Link: Advanced Excel Course – JustAcademy
Demo Link: Register for a Course Demo
Official Website: JustAcademy
1. Introduction to TEXTSPLIT and Data Standardization
Microsoft Excel provides powerful text-processing functions that help users clean, organize, and transform large datasets. The TEXTSPLIT function separates text into multiple rows or columns based on specified delimiters, such as spaces, commas, hyphens, or other characters.
Data standardization is the process of making information consistent in format, structure, and presentation. For example, a dataset may contain full names, email addresses, product codes, and locations stored together in a single cell. Splitting these values into separate columns makes the information easier to filter, analyze, validate, and use in reports.
TEXTSPLIT is especially useful when working with imported CSV data, customer databases, employee records, product descriptions, and transaction details. It is available in supported versions of Microsoft 365 and newer Excel editions that include dynamic array functions.
Learning Objectives
- Understand the purpose and syntax of the TEXTSPLIT function.
- Split text into separate columns or rows using delimiters.
- Use multiple delimiters to separate complex text strings.
- Handle consecutive delimiters, missing values, and empty results.
- Standardize extracted text using TRIM, CLEAN, UPPER, LOWER, and PROPER.
- Combine TEXTSPLIT with other Excel functions for data-cleaning tasks.
- Build practical workflows for preparing datasets for analysis.
2. Understanding the TEXTSPLIT Function
TEXTSPLIT divides a text string into multiple parts using one or more specified delimiters. The resulting values spill automatically into adjacent cells, creating a dynamic array.
Syntax
=TEXTSPLIT(text, col_delimiter, [row_delimiter], [ignore_empty], [match_mode], [pad_with])
Arguments Explained
| Argument |
Description |
| text |
Required. The text string or cell reference that you want to split. |
| col_delimiter |
The character or text used to separate values into different columns. |
| row_delimiter |
Optional. The character or text used to separate values into different rows. |
| ignore_empty |
Optional. TRUE ignores empty values created by consecutive delimiters; FALSE preserves them. The default is FALSE. |
| match_mode |
Optional. 0 performs case-sensitive delimiter matching; 1 performs case-insensitive matching. The default is 0. |
| pad_with |
Optional. The value used to fill missing positions when the resulting array has uneven dimensions. The default is #N/A. |
In most basic examples, you only need the text and column delimiter arguments.
3. Splitting Text into Separate Columns
The most common use of TEXTSPLIT is separating a text string into multiple columns using a delimiter.
Example 1: Splitting a Full Name
Suppose cell A2 contains:
Rahul Sharma Mehta
To split the name using spaces, enter:
=TEXTSPLIT(A2," ")
| Original Text |
Column B |
Column C |
Column D |
| Rahul Sharma Mehta |
Rahul |
Sharma |
Mehta |
Excel automatically places each word into a separate column. The formula can adjust dynamically when the source text changes.
Example 2: Splitting Comma-Separated Values
Suppose A2 contains:
Apple,Banana,Orange,Grapes
Use the following formula:
=TEXTSPLIT(A2,",")
Result: Apple, Banana, Orange, and Grapes appear in four separate columns.
This method is useful when importing product lists, categories, tags, or records separated by commas.
Example 3: Splitting Employee Details
Suppose cell A2 contains:
EMP101- Rahul Sharma - Finance
To split the information using the hyphen delimiter, use:
=TEXTSPLIT(A2,"-")
The output will contain three fields: employee ID, employee name, and department. Because the original text contains spaces around the hyphens, the resulting values may also contain extra spaces. You can clean these values using TRIM.
4. Splitting Text into Separate Rows
TEXTSPLIT can also arrange values vertically by using the row_delimiter argument.
Example: Splitting a List into Rows
Suppose A2 contains:
Excel;Power BI;SQL;Python
Use the following formula:
=TEXTSPLIT(A2,, ";")
The second argument is omitted so that the semicolon is used as the row delimiter instead of the column delimiter.
| Output Cell |
Result |
| B2 |
Excel |
| B3 |
Power BI |
| B4 |
SQL |
| B5 |
Python |
This is useful when a cell contains multiple categories, skills, products, or tags that need to be displayed as individual records.
5. Using Multiple Delimiters
Real-world datasets may use inconsistent separators. Some records may use commas, while others use semicolons or vertical bars. TEXTSPLIT allows an array of delimiters to be supplied so that multiple separator types can be recognized.
Example: Splitting Text with Commas and Semicolons
Suppose A2 contains:
Excel,Power BI;SQL,Python
Use the formula:
=TEXTSPLIT(A2,{",",";"})
Result: Excel, Power BI, SQL, and Python are separated into individual columns.
The delimiter array contains a comma and a semicolon. Excel treats either character as a separator.
Example: Splitting Text Using Spaces and Hyphens
Suppose A2 contains:
EMP-101 Rahul Sharma
To split at either spaces or hyphens, use:
=TEXTSPLIT(A2,{" ","-"})
The output will separate the employee prefix, number, and name into individual fields. However, this approach also splits multiword names into separate columns. Choose delimiters carefully when some fields must remain together.
6. Handling Empty Values and Consecutive Delimiters
Sometimes text contains repeated delimiters, such as multiple spaces or consecutive commas. These may create empty results when the text is split.
Example 1: Preserving Empty Values
Suppose A2 contains:
Apple,,Orange,Grapes
Use:
=TEXTSPLIT(A2,",",,FALSE)
The empty field between the two commas is preserved.
Example 2: Ignoring Empty Values
Use:
=TEXTSPLIT(A2,",",,TRUE)
The empty field is ignored, and the remaining values are returned without that empty element.
Important: Ignoring empty values may shift the position of later fields. Use it only when removing empty fields is appropriate for your dataset.
7. Standardizing Data After Splitting
Splitting text is only one part of data preparation. The resulting values may still contain extra spaces, unwanted characters, inconsistent capitalization, or formatting differences. Standardization helps make these values more reliable.
7.1 Removing Extra Spaces with TRIM
TRIM removes leading and trailing ordinary spaces and reduces repeated internal ordinary spaces to single spaces.
=TRIM(B2)
For example, " Rahul Sharma " becomes "Rahul Sharma".
7.2 Removing Nonprinting Characters with CLEAN
CLEAN removes many nonprinting characters from text. It is useful when data has been copied from external systems or imported from text files.
=CLEAN(B2)
CLEAN does not remove every possible invisible character. For example, nonbreaking spaces may require SUBSTITUTE.
7.3 Combining TRIM and CLEAN
Use both functions when imported text contains unwanted nonprinting characters and unnecessary spaces.
=TRIM(CLEAN(B2))
This helps prepare text for consistent reporting and analysis.
7.4 Standardizing Names with PROPER
PROPER capitalizes the first letter of each word and converts other letters to lowercase.
=PROPER(TRIM(B2))
Example: " rAHUL sHARMA " becomes "Rahul Sharma".
Review names that use special capitalization, such as McDonald or iPhone, because PROPER may not preserve their intended spelling.
7.5 Converting Text to Uppercase with UPPER
UPPER converts letters to uppercase. It is helpful for employee IDs, product codes, and department identifiers.
=UPPER(TRIM(B2))
Example: " emp101 " becomes "EMP101".
7.6 Converting Text to Lowercase with LOWER
LOWER converts letters to lowercase and is useful for email addresses and other text that should use a consistent lowercase format.
=LOWER(TRIM(B2))
Example: " [email protected] " becomes "[email protected]".
8. Combining TEXTSPLIT with Other Excel Functions
8.1 Combining TEXTSPLIT and TRIM
If a comma-separated list contains spaces around each value, use TEXTSPLIT with TRIM to clean the resulting elements.
=TRIM(TEXTSPLIT(A2,","))
For example, "Excel, Power BI, SQL" is split into three values with unnecessary surrounding spaces removed from each result.
8.2 Combining TEXTSPLIT and PROPER
This formula splits a comma-separated list and standardizes each resulting item into proper case.
=PROPER(TRIM(TEXTSPLIT(A2,",")))
Example input: "rahul sharma,PRIYA MEHTA,amit kumar".
The result contains Rahul Sharma, Priya Mehta, and Amit Kumar in separate columns.
8.3 Combining TEXTSPLIT and LOWER
Use this formula to split a list of email addresses and convert each result to lowercase.
=LOWER(TRIM(TEXTSPLIT(A2,",")))
This is useful when preparing email lists for consistent formatting.
8.4 Combining TEXTSPLIT and UPPER
Use the following formula to split a list of product codes and standardize them to uppercase.
=UPPER(TRIM(TEXTSPLIT(A2,",")))
This approach can standardize codes that have been entered using different capitalization styles.
8.5 Combining TEXTSPLIT with IFERROR
IFERROR can display a message if the formula encounters an error. For example:
=IFERROR(TEXTSPLIT(A2,","),"Check Source Data")
This formula returns the split result when successful and displays a message if an error occurs. It should not replace proper investigation of invalid source data.
9. Practical Example: Standardizing Customer Records
Suppose a customer database contains the full name, email address, and city in one cell, separated by vertical bars.
Sample Data
Step 1: Split the Record
Enter the following formula in B2:
=TEXTSPLIT(A2,"|")
The formula separates the name, email address, and city into individual columns. It may leave spaces around the extracted values.
Step 2: Standardize the Name
If the split name is in B2, use:
=PROPER(TRIM(B2))
Step 3: Standardize the Email Address
If the split email address is in C2, use:
=LOWER(TRIM(C2))
Step 4: Standardize the City
If the split city is in D2, use:
=PROPER(TRIM(D2))
Expected Output
For a larger dataset, you can use dynamic array formulas to split records and then apply cleaning formulas to the output columns. Check the final layout before copying the cleaned results into a permanent dataset.
10. Standardizing Data Using a Consistent Workflow
A reliable data-cleaning process should follow a logical sequence. This reduces errors and makes it easier to identify problems.
- Inspect the source: Identify the delimiter, inconsistent capitalization, extra spaces, and missing values.
- Preserve the original data: Keep a backup column or worksheet before modifying records.
- Split the text: Use TEXTSPLIT with the correct column or row delimiter.
- Clean the extracted values: Use TRIM and CLEAN where appropriate.
- Standardize capitalization: Use PROPER for names, LOWER for email addresses, and UPPER for codes when suitable.
- Validate the structure: Confirm that every field appears in the correct column.
- Handle missing information: Check blank cells and unexpected empty fields.
- Verify the results: Compare a sample of cleaned records against the original source.
- Finalize the dataset: Copy and paste values when permanent results are needed.
11. Common Errors and Troubleshooting
| Problem |
Possible Cause |
Solution |
| #NAME? |
The Excel version does not support TEXTSPLIT, or the function name is misspelled. |
Use a supported Excel version or another text-splitting method. |
| #SPILL! |
Cells needed for the dynamic array output are occupied or the spill range is obstructed. |
Clear the destination cells and ensure the output area is available. |
| Extra spaces in results |
The original text contains spaces around delimiters. |
Apply TRIM to the split values. |
| Unexpected empty values |
The source contains consecutive delimiters or leading and trailing delimiters. |
Review the source and use the ignore_empty argument when appropriate. |
| Values split incorrectly |
The chosen delimiter also occurs inside a field that should remain together. |
Choose a more suitable delimiter or use a more controlled extraction method. |
| #N/A in an uneven array |
Multiple rows or columns produce different numbers of values. |
Use the pad_with argument if filling missing positions is appropriate. |
| Some spaces remain after TRIM |
The data contains nonbreaking spaces or other invisible characters. |
Consider SUBSTITUTE with CHAR(160) and then apply TRIM. |
| Formula is displayed as text |
The destination cell is formatted as Text. |
Change the format to General and re-enter the formula. |
12. Best Practices for TEXTSPLIT and Data Standardization
- Identify the delimiter pattern before writing the formula.
- Use TEXTSPLIT when your Excel version supports dynamic array functions.
- Keep sufficient empty space around the formula so the results can spill into adjacent cells.
- Use TRIM to clean ordinary spaces around extracted values.
- Use CLEAN for nonprinting characters, but remember that it does not remove every invisible character.
- Choose UPPER, LOWER, or PROPER according to the field's intended format.
- Do not automatically apply PROPER to acronyms, brand names, or fields that require special capitalization.
- Use the ignore_empty argument carefully because removing empty fields can change column alignment.
- Validate the output before using it in dashboards, reports, or business decisions.
- Keep the original data available until the cleaning process has been verified.
13. Hands-On Practice Exercises
Enter the following values in column A and complete each task using TEXTSPLIT and appropriate cleaning functions.
| Cell |
Sample Text |
Task |
| A2 |
Excel,Power BI,SQL,Python |
Split the values into separate columns. |
| A3 |
rahul sharma;PRIYA MEHTA;amit kumar |
Split the names into columns and standardize capitalization. |
| A4 |
EMP101 | finance | mUMBAI |
Split the employee details and clean extra spaces. |
| A5 |
[email protected],[email protected] |
Split the email addresses and convert them to lowercase. |
| A6 |
Apple,,Orange,Grapes |
Split the list while ignoring empty fields. |
Suggested Solutions
| Task |
Formula |
| Split comma-separated values |
=TEXTSPLIT(A2,",") |
| Split and standardize names |
=PROPER(TRIM(TEXTSPLIT(A3,";"))) |
| Split employee details |
=TRIM(TEXTSPLIT(A4,"|")) |
| Split and lowercase emails |
=LOWER(TRIM(TEXTSPLIT(A5,","))) |
| Ignore empty values |
=TEXTSPLIT(A6,",",,TRUE) |
14. Mini Project: Product Data Cleaning
Project Objective: Convert inconsistent product records into a structured and standardized Excel table.
Sample Input
| Product Record |
| laptop- electronics - india |
| WIRELESS MOUSE-ACCESSORIES-USA |
| keyboard - peripherals - UK |
Project Tasks
- Enter the product records into column A.
- Use TEXTSPLIT with the hyphen as the delimiter.
- Apply TRIM to remove unnecessary spaces from the resulting fields.
- Use PROPER to standardize product names and categories where appropriate.
- Standardize country codes separately if the business requires uppercase codes.
- Check that every record contains the expected number of fields.
- Create a clean table with Product Name, Category, and Country columns.
Example Formula
=PROPER(TRIM(TEXTSPLIT(A2,"-")))
This formula splits the record at each hyphen, removes surrounding ordinary spaces, and converts the resulting values to proper case. If the country field must remain in a specific format, such as uppercase country codes, standardize that field separately.
Expected Outcome: A structured product dataset that is easier to filter, sort, summarize, and use in reports.
15. Interview Questions and Answers
Q1. What is the TEXTSPLIT function?
Answer: TEXTSPLIT divides a text string into multiple rows or columns using specified delimiters.
Q2. What is a delimiter?
Answer: A delimiter is a character or text pattern used to separate values, such as a comma, space, semicolon, or hyphen.
Q3. What is the difference between col_delimiter and row_delimiter?
Answer: col_delimiter separates values horizontally into columns, while row_delimiter separates values vertically into rows.
Q4. What does the ignore_empty argument do?
Answer: It controls whether empty values created by consecutive delimiters are preserved or ignored.
Q5. Why might TEXTSPLIT return a #SPILL! error?
Answer: The output range may contain existing values or otherwise be blocked. Clear the cells needed for the dynamic array.
Q6. How can you remove spaces after splitting text?
Answer: Apply TRIM to the split output, for example, =TRIM(TEXTSPLIT(A2,",")).
Q7. How can you standardize names after splitting them?
Answer: Combine TEXTSPLIT with TRIM and PROPER, such as =PROPER(TRIM(TEXTSPLIT(A2,","))).
Q8. What should you do if TEXTSPLIT is unavailable?
Answer: Use alternatives such as Text to Columns, Power Query, or suitable combinations of other text functions, depending on the task and Excel version.
Q9. Why should the original dataset be preserved?
Answer: Keeping the original data makes it possible to validate the output, correct mistakes, and recover information if a cleaning step produces unexpected results.
Q10. What is the purpose of data standardization?
Answer: Data standardization creates consistent formatting and structure, improving data quality and making analysis and reporting more reliable.
16. Quick Revision Checklist
- TEXTSPLIT separates text using specified delimiters.
- col_delimiter produces horizontal output across columns.
- row_delimiter produces vertical output across rows.
- ignore_empty controls whether empty results are retained.
- TRIM removes extra ordinary spaces.
- CLEAN removes many nonprinting characters.
- UPPER, LOWER, and PROPER standardize text capitalization.
- Dynamic array results require an unobstructed spill range.
- Always validate the cleaned output against the source data.
17. Conclusion
TEXTSPLIT is a powerful Excel function for transforming unstructured text into organized rows and columns. When combined with TRIM, CLEAN, UPPER, LOWER, and PROPER, it supports a practical workflow for cleaning and standardizing datasets.
These techniques are valuable for customer databases, employee records, product catalogs, email lists, and reporting projects. Practicing the formulas and mini project will help you prepare cleaner, more consistent data for advanced Excel analysis and business reporting.
Learn Advanced Excel with JustAcademy
Explore the Advanced Excel course to improve your formula skills, develop data-cleaning techniques, and practice real-world spreadsheet tasks.
Course Page: Explore the Advanced Excel Course
Register for a Demo: Register for a Course Demo
Official Website: Visit JustAcademy