Line breaks in Excel

A line break is the termination of one line of text, and the beginning of the next line.

If needed inside of a single Excel cell, line breaks can be achieved in two ways:

  • the Wrap Text feature allows you to make text appear to be structured into multiple lines,
  • manual line breaks can be entered by pressing Alt + Enter.

 

Consider the following sentence:

As of Unicode version 14.0, there are 144,697 characters with code points, covering 159 modern and historical scripts, as well as multiple symbol sets.

If inputted into an Excel cell, it will look awkward:

line in Excel

 

With the help of the Wrap Text feature, it can also appear to be placed on multiple lines in a cell:

line in Excel, Wrap Text

The key word here is “appear”, as there are actually no line breaks involved. Excel is merely presenting your text as having line breaks based on the width of your cell.

If your text doesn’t fit, you can increase the width and/or height of your columns and/or rows. If you want to adjust your line breaks, you can do that by changing your column width.

This is both an advantage (your lines adjust automatically based on column width) and a disadvantage (sometimes you want your line breaks to stay in the same place regardless of column width).

 

You can also manually add your line breaks with the help of the Alt + Enter keyboard shortcut:

line in Excel, Alt + Enter keyboard shortcut line breaks

Line break in this case is an actual character, albeit a specific type of control (formatting) character.

This can be easily demonstrated if we copy our table into Microsoft Word and Show hidden formatting symbols:

line in Excel, Alt + Enter line breaks copy to Word

 

This also means we will have at our disposal more tools with which to manipulate line breaks.

The specific character in this case is Line feed, and the Line feed number correspondent to its code point is 10.

Knowing that, we can, for example, also generate line breaks with formulas:

line in Excel with UNICHAR

With the help of the UNICHAR function, which returns the Unicode character that is referenced by a given numeric value (10 for line feed), we’ve generated our mailing address.

Weirdly enough, this kind of returns will only work as intended if Wrap Text is also enabled on the cell with this kind of formula.

On the other hand, with the help of the CLEAN function we can remove line breaks (and other nonprintable characters) from the text:

CLEAN nonprintable characters

 

A few additional notes

In Excel, line breaks can also be inserted using Find & Replace. We can accomplish this by replacing any given character with the Ctrl + J keyboard combination:

line breaks with Find & Replace (CTRL+J keyboard shortcut)

 

In Excel, Alt + Enter can also insert line breaks into formulas, making your formulas easier to read and manage.

Nonprintable characters such as line breaks and spaces will not affect formula execution:

line breaks in formulas

The formula is the same, but in the second example, it is obviously easier to manage.

 

Dig deeper:

Text in Excel

UNICODE and UNICHAR functions

3 thoughts on “Line breaks in Excel”

Leave a Reply