Data Import & Export

Remove Line Breaks Before Splitting Text into Columns in Excel

Bushra ParveenBushra Parveen Dec 2, 2026 868 views

Question details

Replace embedded line breaks with delimiters before splitting cell contents into columns.

Remove Line Breaks Before Splitting Text into Columns in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
A worksheet contains multiline text that needs to be separated into individual columns, potentially as part of a large or recurring report.
Observed behavior
The desired result is a set of columns created from text that was originally separated by embedded line breaks.
Before you start

Check whether the source cells contain line feeds, carriage returns, or both, and choose a delimiter that does not already occur in the text. Make sure there are empty columns to the right of the split range.

Solution 1Recommended

Replace Line Breaks with a Formula and Split the Results

Use a formula when you want to prepare a separate copy of the text before splitting it.

1
Enter the replacement formula

In an empty cell next to the first source cell, enter =SUBSTITUTE(A1,CHAR(10),",") to replace line feeds with commas. Replace A1 with the address of your source cell.

2
Handle carriage returns if needed

If the text contains carriage returns as well as line feeds, use =SUBSTITUTE(SUBSTITUTE(A1,CHAR(13),""),CHAR(10),",") instead.

3
Fill and copy the results

Drag the formula's fill handle down the rows you need. Copy the results and use Paste Special > Values in an empty range.

4
Split the text

Select the pasted values, choose Data > Text to Columns, select Delimited, and choose Comma. Preview the result and click Finish.

Replace Line Breaks with a Formula and Split the Results
Choose a safe delimiter: If commas already appear within the text you want to keep together, use a different character in the formula and select that delimiter in Text to Columns.
Work with multiline spreadsheet data

Replace Line Breaks and Split Text in WPS Spreadsheets

Use a SUBSTITUTE formula in WPS Spreadsheets to replace embedded line feeds, then use Text to Columns to separate the cleaned text.

  1. 1. Open the worksheet: Open WPS Spreadsheets and use Menu > Open to select your Excel workbook.
  2. 2. Replace the line breaks: In an empty cell, enter =SUBSTITUTE(SUBSTITUTE(A1,CHAR(13),""),CHAR(10),",") and adjust A1 to match the source cell.
  3. 3. Prepare the results: Fill the formula down as needed, then copy the results and use Paste Special > Values in an empty range.
  4. 4. Split into columns: Select the pasted values, choose Data > Text to Columns, select a comma delimiter, and finish the wizard.
Replace line breaks with a delimiter before splitting textOpen and edit Microsoft Excel XLSX and XLS filesUse familiar spreadsheet formulas and data toolsWork with a free Office suite
microsoft office alternative - wps office

Frequently Asked Questions

What does CHAR(10) represent in an Excel formula?

CHAR(10) represents a line-feed character. Use =SUBSTITUTE(A1,CHAR(10),",") to replace line feeds in A1 with commas.

What if my text contains both carriage returns and line feeds?

Use =SUBSTITUTE(SUBSTITUTE(A1,CHAR(13),""),CHAR(10),",") to remove carriage returns and replace line feeds with commas.

Can I split directly on a line break without replacing it first?

In Excel for Windows, select the cells, choose Data > Text to Columns > Delimited, select Other, and press Ctrl+J in its delimiter box. Check the preview before clicking Finish.

When should I use Power Query instead of a formula?

Power Query is useful for large or recurring reports because you can define the cleaning and splitting steps once. Open the range with Data > From Table/Range, then use Data > Refresh All when the source changes.