Line Break Char Excel: How to Add New Lines in Cells
In this article
To insert a line break in an Excel cell, use the keyboard shortcut Alt + Enter while typing in a cell, or use the CHAR(10) function within a formula to combine text with a line break. This allows you to stack multiple pieces of information within a single cell rather than stretching the column width to an impractical size.
What You'll Need
- A computer with Microsoft Excel installed (Windows or macOS).
- A dataset or specific cells where you want to organize text vertically.
- Basic knowledge of how to enter a formula in Excel.
Step-by-Step
Method 1: Manual Line Breaks (The Shortcut)
This is the fastest way to add a line break when you are manually entering data or editing a specific cell. Note that labels and menu options may differ slightly depending on your version of Excel or your operating system.
- Double-click the cell where you want to insert the line break, or select the cell and press F2 to enter edit mode.
- Type the first line of text.
- Hold down the Alt key and press Enter. The cursor will move to a new line within the same cell.
- Type the second line of text.
- Repeat the Alt + Enter process for as many lines as you need.
- Press Enter (without Alt) to finalize the entry and exit the cell.
Method 2: Formula-Based Line Breaks (The CHAR Function)
When you need to combine data from multiple cells (concatenation) and want each piece of data on a new line, you must use the line break character code. In Windows, the character code for a line feed is 10.
- Select the cell where you want the combined result to appear.
- Start your formula with an equals sign:
=. - Select the first cell you want to include (e.g., A2).
- Type the ampersand symbol (
&), which is used in Excel to join strings of text. - Type
CHAR(10). This tells Excel to insert the invisible line break character. - Type another ampersand (
&). - Select the second cell you want to include (e.g., B2).
- The full formula should look like this:
=A2&CHAR(10)&B2. - Press Enter.
Method 3: Enabling Wrap Text (The Critical Final Step)
Regardless of whether you used Alt+Enter or the CHAR(10) formula, the line break will not be visible unless the cell is set to wrap text. By default, Excel displays content in a single continuous line.
- Select the cell, row, or column containing your line breaks.
- Go to the Home tab on the top ribbon.
- In the Alignment group, locate and click the Wrap Text button.
- The cell height will automatically expand (or you can manually adjust it) to show the text on multiple lines.
Common Mistakes
One of the most frequent errors is forgetting to enable Wrap Text. Users often enter the CHAR(10) formula or use Alt+Enter and then complain that the data still looks like one long string or that the second line is hidden. Without Wrap Text enabled, Excel ignores the line break character for display purposes.
Another common mistake is using the wrong character code. Some users attempt to use CHAR(13), which is a carriage return. While this works in some programming languages and older systems, Excel specifically recognizes CHAR(10) as the line feed character for cell wrapping in Windows. Using the wrong number will result in a strange symbol (like a small box) appearing in the cell instead of a break.
Users also frequently forget the ampersands when using the CHAR function. Writing =A2 CHAR(10) B2 will result in a formula error because Excel requires the & operator to glue the cell reference and the character function together.
Tips
To apply line breaks to an entire column quickly, do not do it manually. Use the formula method described above in the first cell of the column, then hover your mouse over the bottom-right corner of that cell (the fill handle) and double-click or drag it down to apply the logic to all rows. This ensures consistency across thousands of rows of data.
If you are using a Mac, the keyboard shortcut is slightly different. Depending on your version and keyboard settings, you may need to use Option + Command + Return or Control + Option + Return to achieve the same result as Alt+Enter on Windows.
For those who need to clean up data imported from other software that contains messy line breaks, you can use the Find and Replace tool. While you cannot type a line break directly into the 'Find what' box, you can sometimes copy a line break from a cell and paste it into the search box to replace it with a comma or a space for better data portability.
Troubleshooting
If your line breaks are still not appearing after following the steps, check the following in order:
- Verify Wrap Text: Ensure the Wrap Text button is highlighted in the Home tab. If it is off, the line break exists in the data but is invisible to the eye.
- Check Row Height: Sometimes the row height is locked. If the row is too short, you will only see the first line of text. Hover your mouse over the boundary between the row numbers on the far left and double-click to auto-fit the height to the content.
- Formula Syntax: If you see
#VALUE!or#NAME?, check your ampersands. Ensure there is an&before and after theCHAR(10)part of the formula. - Cell Formatting: Ensure the cell is formatted as 'General' or 'Text'. If the cell is formatted as 'Number' or 'Date', the formula may behave unexpectedly or display as a series of digits.
Frequently Asked Questions
Can I use line breaks in an Excel table?
Yes, line breaks work inside official Excel Tables (created via Ctrl+T). You can use both the Alt+Enter shortcut and the CHAR(10) formula. However, be aware that very tall rows in a table can make scrolling through your data more cumbersome.
Does the CHAR(10) function work on Mac?
Yes, CHAR(10) is the standard line feed character for Excel on both Windows and macOS. While the keyboard shortcuts differ between the two operating systems, the formula remains the same.
How do I remove line breaks from a whole sheet?
The most efficient way to remove them is using the CLEAN function. For example, =CLEAN(A1) will remove all non-printable characters, including line breaks, from the text in cell A1.
Will line breaks affect my data when exporting to CSV?
Yes, line breaks can cause issues when exporting to a CSV (Comma Separated Values) file because CSVs use line breaks to signify the end of a record. Most modern software will wrap the cell content in double quotes to protect the internal line break, but some older systems may interpret the internal break as a new row of data.
Can I use a line break in a Data Validation dropdown list?
No, Excel does not support multi-line entries within the standard Data Validation dropdown menu. The dropdown will display the text as a single line, even if the source cell contains line breaks.
Is there a limit to how many line breaks I can put in one cell?
There is no specific limit on the number of line breaks, but there is a limit to the total number of characters a cell can hold (32,767 characters). Additionally, Excel can only display up to 255 rows of height for a single row; if your line breaks push the text beyond that height, the remaining text will be cut off visually.