TEXTSPLIT separates text at every occurrence of a delimiter and spills the results into neighbouring cells, so one formula can split a field with several parts. It needs Microsoft 365, Excel for the web or Excel 2024; older versions return #NAME? instead.
What you need
- Excel for Microsoft 365, Excel for the web or Excel 2024
- A column with combined fields and a consistent delimiter
- Empty cells to the right, for the spilled results
Step 1: Clean the field first
Trim the combined field with =TRIM(SUBSTITUTE(A2,CHAR(160),’ ‘)) in a helper column. Splitting dirty text reintroduces the spaces you were trying to remove, so clean first and split second.
Step 2: Enter the TEXTSPLIT formula
In the first empty cell beside the cleaned field, enter =TEXTSPLIT(D2,’ / ‘) with the delimiter your data uses, including the spaces around it. The parts spill across the row into the empty cells.
Step 3: Check the spill and handle missing parts
Confirm every row split into the expected number of parts. If a row lacks the delimiter, TEXTSPLIT returns #N/A unless you pass the if_not_found argument; investigate those rows rather than hiding the error.
Worked example: synthetic sample ID and site field
The table below is a synthetic example. It shows the expected result of splitting fields; no workbook was opened.
| Combined field | Part 1 | Part 2 |
|---|---|---|
| WS-0231 / Site B | WS-0231 | Site B |
| WS-0232 / Site C | WS-0232 | Site C |
| WS-0233 / Site A | WS-0233 | Site A |
| Rows split | 4 | All clean |
Expected result (UNTESTED). all 4 combined fields split into sample ID and site, with no trailing spaces left on either part. The two new columns can be filtered and looked up separately. This check was not run live; the table shows the expected result for the synthetic example.
Limits
- TEXTSPLIT is not available in Excel 2021 or earlier; use FIND with LEFT and MID there.
- The destination cells must be empty, or Excel returns #SPILL!.
- Including the spaces in the delimiter matters; splitting on the slash alone leaves a trailing space.
