Excel · ChatGPT

Split Text in Excel

Turn imported strings into reliable columns without overwriting the source. Choose Text to Columns or TEXTSPLIT, preserve empty fields, and control whether Excel splits every delimiter or only the last one.

Choose your situation — copy the tested prompt:
I have these imported values in Excel cells A2:A3:

CUST-1042|North|Active
CUST-1180|West|Paused

I need three output columns named Customer ID, Region, and Status.

Show me two safe methods:
1. Text to Columns for a one-time conversion;
2. a TEXTSPLIT formula for a dynamic result in Microsoft 365.

For Text to Columns, tell me how to avoid overwriting adjacent data and how to preserve the original column. For TEXTSPLIT, give the exact formula entered in B2 and explain the spill range. State the exact expected outputs for both rows. Do not split the hyphen inside the customer ID.

Test 1 of 3 — approved PASS and preserved as tested.

I need to split imported tags in Excel, but the source uses both commas and semicolons:

A2: Red,Blue;Green
A3: Red;;Green
A4: Red, Blue;Green

Give me a Microsoft 365 formula that:
1. treats comma and semicolon as alternative delimiters;
2. preserves the empty field in A3 so its position is not lost;
3. removes only incidental spaces around individual values;
4. does not merge or reorder the tags;
5. explains what happens when the formula spills into occupied cells.

Use TEXTSPLIT and provide the exact formula for B2. State the expected three output cells for each input row. If a formula option would suppress empty fields, explicitly explain why it is unsafe for this dataset.

Test 2 of 3 — approved PASS and preserved as tested.

These imported descriptions are in A2:A4:

INV-2026-001 - Acme - Urgent
INV-2026-002 - Beta
INV-2026-003

I need exactly two output columns:
- Base description: everything before the last occurrence of space-hyphen-space (" - ")
- Final label: everything after the last occurrence

The hyphens inside invoice IDs must remain unchanged. If the delimiter does not exist, keep the full original text as Base description and return a blank Final label.

Give exact Microsoft 365 formulas for B2 and C2 using TEXTBEFORE and TEXTAFTER with the appropriate instance number and fallback handling. State the expected output for all three rows. Preserve column A unchanged and mention how I should spot-check imported values with inconsistent spacing.

Test 3 of 3 — approved PASS and preserved as tested.

Before — CUST-1042|North|Active
Source conditionRisk
CUST-1042|North|ActiveOne imported field; adjacent cells may already contain data.
After — verified result
OutputExpected result
Three fieldsCUST-1042 · North · Active using | only
Before — Red;;Green
Source conditionRisk
Red;;GreenTwo delimiters with a meaningful empty middle position.
After — verified result
OutputExpected result
Preserved positionRed · blank · Green with ignore_empty = FALSE
Before — INV-2026-001 - Acme - Urgent
Source conditionRisk
INV-2026-001 - Acme - UrgentEvery hyphen is not a valid delimiter.
After — verified result
OutputExpected result
Last occurrence onlyINV-2026-001 - Acme · Urgent
Diagnosis — what can make this workflow unsafe
Wrong delimiter
Splitting on hyphen breaks customer and invoice IDs
Data loss
Occupied spill range
TEXTSPLIT returns #SPILL! when destination cells are not empty
Check first
Empty field removed
ignore_empty = TRUE shifts positional data left
High risk
Inconsistent spacing
A delimiter such as " - " will not match every imported variation
Spot-check

How to Split Text in Excel

Practical workflow — 5 steps
1

Preserve the source

Keep column A unchanged and choose an empty destination range before splitting.

2

Identify the delimiter rule

Decide whether the task uses one delimiter, alternative delimiters, or only the first/last occurrence.

3

Choose the method

Use Text to Columns for a controlled one-time conversion or TEXTSPLIT for dynamic Microsoft 365 output.

4

Protect positional blanks

Set TEXTSPLIT's ignore_empty argument to FALSE when empty fields carry meaning.

5

Verify the result

Check the number and order of output columns, #SPILL! errors, IDs containing punctuation, and rows with missing delimiters.

Verification rule: keep the source unchanged until the approved expected result, data types, row counts, and control checks agree with the workbook.

Split Text in Excel — FAQs

How do I split text into columns in Excel?
Use Text to Columns for a one-time conversion or TEXTSPLIT for a dynamic result. Preserve the source and choose an empty destination range.
What is the TEXTSPLIT formula for a pipe delimiter?
Use =TEXTSPLIT(A2,"|"). The result spills horizontally into adjacent cells, which must be empty.
Can TEXTSPLIT use multiple delimiters?
Yes. Pass an array such as {",",";"} as the column delimiter so either character starts a new field.
How do I keep empty fields when splitting text?
Set the TEXTSPLIT ignore_empty argument to FALSE. Removing empty fields can shift later values into the wrong positions.
How do I split text at only the last delimiter?
Use TEXTBEFORE and TEXTAFTER with instance number -1, wrapped in IFERROR when some rows do not contain the delimiter.

Related Excel workflows