Spreadsheet Practice

How to split text by line break in Excel

Excel formula

=TEXTSPLIT(A2,CHAR(10))

Use CHAR(10), the line break character, as the delimiter: =TEXTSPLIT(A2,CHAR(10)) in Excel 365, =SPLIT(A2,CHAR(10)) in Google Sheets.

Result on the example
one result per row in B2, filled down to B6
Works in
Excel 2024 and Microsoft 365
Google Sheets
Different formula, see below

See it work

The formula is already in B2, filled down to B6. Change any input and the result updates, or edit the formula to experiment.

How it works

A line break typed with Alt+Enter is the character with code 10, so CHAR(10) is the delimiter. TEXTSPLIT spills the lines to the right: the company in B, the street in C and the city in D.

=TEXTSPLIT(A2,CHAR(10))

Result{1 row × 3 cols} "Northwind Traders", "1420 Lake St", "Minneapolis, MN 55401"

  1. A2"Northwind Traders 1420 Lake St Minneapolis, MN 55401"

    The value in A2.

  2. CHAR(10)" "

    CHAR: Character for a code number.

    • number10
  3. TEXTSPLIT(A2,CHAR(10)){1 row × 3 cols} "Northwind Traders", "1420 Lake St", "Minneapolis, MN 55401"

    TEXTSPLIT: Splits text across columns, and rows, at the delimiters you give.

    • textA2"Northwind Traders 1420 Lake St Minneapolis, MN 55401"
    • col_delimiterCHAR(10)" "

In Google Sheets

Google Sheets needs a different formula: =SPLIT(A2,CHAR(10)). On the same data it gives the same result. Here it is running in Google Sheets mode.

Other ways to do it

Each one was run on the same example sheet.

FormulaResultWhen to use it
=LEFT(A2,FIND(CHAR(10),A2)-1)Northwind Traders, Contoso Ltd, Fabrikam Inc…Works in every version, for the first line only. Use MID with FIND for the others.

Common mistakes

  • Text from Windows files can have a carriage return before each line break (CHAR(13) then CHAR(10)). The extra character is invisible but breaks lookups; split on CHAR(13)&CHAR(10) or clean with CLEAN.
  • Wrapped text without real line breaks doesn't split: the wrapping is only on screen.

Try it yourself

Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.

Split text by line break

In B2, split the address at each line break so each line lands in its own column (B, C, D). Fill down to B6.

Questions

How do I split the lines into rows instead?

Use the row delimiter: =TEXTSPLIT(A2,,CHAR(10)).

How do I replace the line breaks with commas?

Use =SUBSTITUTE(A2,CHAR(10),", ").

Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.