Line Breaks in Excel: In a Cell and in a Formula
By ExcelReady TeamUpdated 6 min read
The short answer
To add a line break inside a formula, join CHAR(10) between the pieces of text: =A2&CHAR(10)&B2. Then turn on Wrap Text (Home > Wrap Text), or the break won't show. To type a line break directly in a cell, press Alt+Enter on Windows or Option+Return on a Mac. To remove breaks, use SUBSTITUTE(A2,CHAR(10),", ").
Key takeaways
- CHAR(10) is the line break character; join it with & or use it as TEXTJOIN's separator.
- Wrap Text must be on for the cell, or the line break won't show.
- To type a break by hand, press Alt+Enter (Windows) or Option+Return (Mac) while editing the cell.
- SUBSTITUTE(A2,CHAR(10),", ") replaces line breaks with commas; CLEAN removes them completely.
- In Find and Replace on Windows, press Ctrl+J in the Find box to search for a line break.
On this page+
- Two ways to add a line break
- How to start a new line in a cell
- How to add a line break in a formula with CHAR(10)
- Build a multi-line label or address
- Use a line break inside an IF result
- How to remove line breaks
- Find and replace line breaks without a formula
- Split text at line breaks
- Count the lines in a cell
- Practise it
To put a line break in an Excel formula, you join the special character CHAR(10) between the pieces of text and turn on Wrap Text. To add a break while typing in a cell, you press Alt+Enter on Windows or Option+Return on a Mac. This guide covers both, plus how to find, replace, remove and split line breaks in data you've imported.
Two ways to add a line break#
There are two situations, and each has its own method:
| You want to | Method | Example |
|---|---|---|
| Type a break by hand in a cell | Alt+Enter (Windows) or Option+Return (Mac) | Typing an address into one cell |
| Build a break inside a formula | CHAR(10) joined with & | =A2&CHAR(10)&B2 |
Both put the same invisible character into the cell: the line feed, which is character number 10. That matters later, because the same CHAR(10) is what you search for when you want to remove or split breaks.
How to start a new line in a cell#
To type a line break directly in a cell:
- Double-click the cell, or select it and press F2, to start editing.
- Put the cursor where the new line should start.
- Press Alt+Enter on Windows. On a Mac, press Option+Return (in some versions, Control+Option+Return).
- Press Enter to finish.
Excel turns on Wrap Text for that cell automatically, so the second line appears straight away. Pressing Enter alone, without Alt or Option, just moves to the next cell. You can add as many breaks as you like, and each one starts a new line inside the same cell.
How to add a line break in a formula with CHAR(10)#
CHAR returns the character for a code number, and CHAR(10) is the line break. Join it between two pieces of text with &:
=A2&CHAR(10)&B2With "12 Park Road" in A2 and "Leeds" in B2, the cell shows:
12 Park Road
LeedsTurn on Wrap Text, or the break stays hidden and the text looks like "12 Park RoadLeeds". Select the cell and click Home > Wrap Text. If the row doesn't grow, double-click the border below the row number to fit its height. The formatting lesson covers Wrap Text and row heights.
Excel on Windows and on current Macs both use CHAR(10) for line breaks, so the same formula works on both.
Build a multi-line label or address#
CHAR(10) works anywhere you join text. An address label with a name, street and city:
=A2&CHAR(10)&B2&CHAR(10)&C2For more than two lines, TEXTJOIN is shorter. Use CHAR(10) as the separator:
=TEXTJOIN(CHAR(10),TRUE,A2:D2)The TRUE skips empty cells, so a missing second address line doesn't leave a blank line. TEXTJOIN needs Excel 2019 or later. The guide to combining text in Excel covers TEXTJOIN in more detail.
Numbers and dates in a multi-line label need TEXT to keep their format, for example ="Invoice "&A2&CHAR(10)&"Due "&TEXT(B2,"d mmm yyyy"). See how to combine a date and text for the format codes, and adding text to the start or end of cells for other ways to build labels.
Use a line break inside an IF result#
A line break can be part of any formula result, including IF. To show a status and the detail underneath it:
=IF(C2>0,"Overdue"&CHAR(10)&C2&" days","On time")If C2 holds 12, the cell shows "Overdue" on the first line and "12 days" on the second. Rows with 0 just show "On time".
Line breaks look best with a fixed column width. If the column is too narrow, Wrap Text also breaks lines in places you didn't choose. Set the width wide enough for your longest line, and the text then breaks only where your CHAR(10) sits.
How to remove line breaks#
Data copied from emails, web forms or other systems often has line breaks you don't want. Replace each one with a space or a comma using SUBSTITUTE:
=SUBSTITUTE(A2,CHAR(10),", ")A two-line address becomes 12 Park Road, Leeds. Use " " instead of ", " to replace each break with a space.
CLEAN also removes line breaks, along with other non-printing characters:
=CLEAN(A2)But CLEAN removes the break without putting anything in its place, so "12 Park Road" and "Leeds" run together as "12 Park RoadLeeds". SUBSTITUTE is usually the better choice.
Find and replace line breaks without a formula#
On Windows, Find and Replace can search for line breaks directly:
- Select the cells and press Ctrl+H.
- Click in Find what and press Ctrl+J. The box looks empty, but it now holds a line break (you may see a tiny blinking dot).
- In Replace with, type a space or a comma.
- Click Replace All.
The Ctrl+J trick is a Windows feature. On a Mac, use the SUBSTITUTE formula above instead.
Split text at line breaks#
To split a multi-line cell into separate cells, use TEXTSPLIT in Microsoft 365 or Excel 2024:
=TEXTSPLIT(A2,,CHAR(10))The two commas leave the column delimiter empty, so each line goes into its own row. Use =TEXTSPLIT(A2,CHAR(10)) to split into columns instead. In older Excel, use Data > Text to Columns, choose Delimited, tick Other and press Ctrl+J in the box.
Count the lines in a cell#
To count lines, count the breaks and add one:
=LEN(A2)-LEN(SUBSTITUTE(A2,CHAR(10),""))+1LEN gives the total length, and the SUBSTITUTE part removes every break. The difference is the number of breaks. For a two-line address, the result is 2. The same trick counts any character, such as commas or spaces.
Practise it#
Joining text with separators, including line breaks, is a skill you'll use in reports and labels. Practise joining text in a live spreadsheet: you type the formulas and each one is checked instantly. Then practise more formatting to get comfortable with Wrap Text, alignment and row heights.
Try it yourself
This is a live spreadsheet. Type the formula in the green cell and press Enter.
Build a two-line address. In C2, join the street in A2 and the city in B2 with a line break between them, using CHAR(10).
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Address label | |||
| 2 | Leeds | |||
| 3 | Bristol | |||
| 4 | Glasgow | |||
| 5 | ||||
| 6 | ||||
| 7 |
Tip: Join three pieces with &: the street, CHAR(10), and the city.
Practise this in a lesson
Frequently asked questions
How do I add a line break in an Excel formula?
Join CHAR(10) between the parts, like =A2&CHAR(10)&B2, then turn on Wrap Text for the cell. CHAR(10) is the line feed character Excel uses for breaks.
Why doesn't CHAR(10) create a new line?
Wrap Text is off for that cell. Select it and click Home, Wrap Text. You may also need to make the row taller, or double-click the row border to fit it.
How do I start a new line in an Excel cell?
Double-click the cell, or press F2, to edit it. Put the cursor where you want the break and press Alt+Enter on Windows or Option+Return on a Mac.
How do I remove line breaks in Excel?
Use =SUBSTITUTE(A2,CHAR(10)," ") to replace each break with a space, or =CLEAN(A2) to remove them. On Windows you can also use Find and Replace with Ctrl+J in the Find what box.
How do I split text at line breaks?
In Microsoft 365, use =TEXTSPLIT(A2,CHAR(10)) to split into columns, or =TEXTSPLIT(A2,,CHAR(10)) to split into rows. In older Excel, use Text to Columns with Ctrl+J as the Other delimiter.