To insert a new line character in an Excel formula, use the function CHAR(10) combined with the ampersand (&) symbol for concatenation. For this to be visible in the cell, you must also enable Wrap Text in the Home tab of the ribbon. For example, the formula ="First Line"&CHAR(10)&"Second Line" will place the two text strings on separate lines within a single cell.
What You'll Need
- A computer with Microsoft Excel installed (Windows or macOS).
- A dataset or specific cells where you want to combine multiple pieces of information into a multi-line format.
- Basic familiarity with Excel formulas and the Ribbon menu.
Step-by-Step
- Identify the Data to Combine: Determine which cells or text strings you want to separate with a line break. For instance, if cell A2 contains a name and cell B2 contains an address, you may want them stacked vertically in cell C2.
- Start the Formula: Click on the cell where you want the result to appear. Type the equals sign (
=) to begin the formula. - Insert the First Element: Select the first cell reference or type your first string of text inside quotation marks. Example:
=A2or="Order Details:". - Add the Concatenation Symbol: Type the ampersand (
&). In Excel, this symbol tells the program to join two different values together into one string. - Insert the New Line Code: Type
CHAR(10). This specific function tells Excel to insert the ASCII character 10, which represents a line feed (the technical command for a new line). - Add the Second Concatenation Symbol: Type another ampersand (
&) to prepare for the next piece of data. - Insert the Second Element: Select the second cell reference or type the second string of text in quotes. Example:
=A2&CHAR(10)&B2. - Commit the Formula: Press Enter. At this stage, you will likely notice that the text still appears on one single line, or the line break is invisible. This is normal behavior.
- Enable Wrap Text: With the cell still selected, go to the Home tab on the Ribbon. In the Alignment group, click the Wrap Text button. Labels may differ slightly by version or region, but it is typically found in the center of the Home tab.
- Adjust Row Height: If the text looks cut off, hover your mouse over the boundary line below the row number on the far left of the screen. Click and drag the boundary down to expand the row height so all lines of text are visible.
Common Mistakes
One of the most frequent errors is forgetting the ampersand symbols. Because CHAR(10) is a function and not a text string, it cannot be placed inside quotation marks. Writing ="Line 1"&"CHAR(10)"&"Line 2" will literally print the text "CHAR(10)" in your cell rather than creating a line break. The function must stand alone, joined to the text by ampersands.
Another common mistake is omitting the Wrap Text setting. Many users assume that the CHAR(10) code automatically triggers a visual line break. However, Excel's default cell formatting is to display content in a single continuous line. Without Wrap Text enabled, the cell will either show the text as one long string or truncate it, making it seem as though the formula failed.
Users also occasionally confuse CHAR(10) with CHAR(13). While CHAR(13) represents a carriage return, Excel for Windows specifically recognizes CHAR(10) as the standard for internal cell line breaks. Using the wrong character code may result in a small square symbol or no break at all, depending on the version of Excel and the operating system.
Tips
To make your formulas easier to read, you can add spaces or punctuation before the line break. For example, =A2&" - "&CHAR(10)&B2 adds a dash and a space before moving to the next line, which can help visually separate categories of data.
If you are combining a large number of cells (more than three), consider using the TEXTJOIN function if your version of Excel supports it. TEXTJOIN allows you to specify a delimiter once and apply it to a whole range. The formula would look like: =TEXTJOIN(CHAR(10), TRUE, A2:E2). This tells Excel to use a new line as the separator for every cell in the range from A2 to E2, while the TRUE argument tells it to ignore any empty cells in that range.
When applying this to a large column, you do not need to manually enable Wrap Text for every single cell. Select the entire column by clicking the letter at the top, then click Wrap Text. This applies the formatting to every cell in that column, including those you will fill in later.
Troubleshooting
If the line break is still not appearing after following the steps, first check the formula syntax. Ensure there are no missing quotation marks around your text strings and that every element is separated by an ampersand. A single missing & will cause a #VALUE! error or a syntax alert.
If the formula is correct and Wrap Text is on, but you only see the first line, check the row height. Excel does not always automatically expand the row height to fit multi-line content when using formulas. Double-click the bottom boundary of the row header to "AutoFit" the row, which will automatically expand the cell to show all generated lines.
If you see a strange symbol (like a small box or a question mark) instead of a line break, it usually means the cell is formatted as "Text" rather than "General". Change the cell format to General via the Home tab's number format dropdown, then click into the formula bar and press Enter again to re-evaluate the formula.
For those using Excel on a Mac, CHAR(10) is the standard, but in some very old legacy versions, different character codes were used. Ensure your software is updated to the latest version to maintain compatibility with standard ASCII character codes.
Frequently Asked Questions
Can I use a keyboard shortcut instead of a formula?
Yes. If you are typing manually into a cell and want a new line, press Alt + Enter (Windows) or Option + Command + Return (Mac). This inserts a hard return without needing a formula.
Does CHAR(10) work in Google Sheets?
Yes, CHAR(10) works identically in Google Sheets. You must also ensure that the "Wrap" setting is enabled for the cell to see the result.
Will this work if I export the file to a CSV?
CSV files are plain text. While the line break is technically there, how it appears depends on the program used to open the CSV. Most text editors will show it, but some simple importers may strip the character or treat it as a new record.
Can I use this in a Conditional Formatting formula?
No, CHAR(10) is used for displaying content in a cell. Conditional Formatting is used to change the appearance (color, font, border) of a cell based on a rule; it cannot change the actual text content or insert line breaks into existing data.
How do I remove all new line characters from a column?
You can use the SUBSTITUTE function. Use the formula =SUBSTITUTE(A2, CHAR(10), " ") to replace every new line character with a single space, effectively flattening the text back into one line.