Excel Insert Return in Formula: How to Add Line Breaks
In this article
To insert a return (line break) in an Excel formula, you must use the CHAR function. Specifically, for Windows users, the formula is CHAR(10), and for Mac users, it is CHAR(13). Because a line break is a non-printable character, you cannot simply press Enter while typing a formula; instead, you concatenate the CHAR function into your text string using the ampersand (&) symbol, and then enable Wrap Text on the cell to make the break visible.
What You'll Need
- A computer with Microsoft Excel installed (Windows or macOS).
- A cell containing data or a formula where you want the text to split into multiple lines.
- Basic knowledge of how to use the ampersand (&) for concatenation in Excel.
Step-by-Step
- Select the target cell: Click on the cell where you want the multi-line result to appear. If you are editing an existing formula, double-click the cell or click into the Formula Bar at the top of the screen.
- Start your formula: Begin your formula with an equals sign (=). For example, if you are combining a first name in cell A2 and a last name in cell B2, start with
="Name: " & A2. - Insert the line break character: To tell Excel to start a new line, add an ampersand, followed by the CHAR function.
- On Windows, type
& CHAR(10) &. - On Mac, type
& CHAR(13) &.
="Name: " & A2 & CHAR(10) & "Address: " & C2. - On Windows, type
- Complete the remaining text: Add the rest of your data or cell references after the second ampersand. Ensure all static text is enclosed in double quotation marks.
- Press Enter: Once the formula is written, press the Enter key. At first, the result may still look like a single line of text, or the text may appear cut off. This is normal.
- Enable Wrap Text: This is the most critical step. Excel will not render the line break unless the cell is set to wrap text.
- Keep the cell selected.
- Go to the Home tab on the Ribbon.
- In the Alignment group, click the Wrap Text button.
- Adjust Row Height: If the text still looks cramped or the second line is hidden, hover your mouse over the boundary line below the row number on the far left. Click and drag the boundary down to increase the row height, or double-click the boundary to auto-fit the content.
Common Mistakes
One of the most frequent errors is forgetting the ampersands. In Excel, the ampersand acts as the glue that joins different pieces of data together. If you simply write "First Line" CHAR(10) "Second Line", Excel will return a #NAME? error because it does not recognize the sequence as a valid command. You must place an & before and after the CHAR function to merge it with the surrounding text.
Another common mistake is using the wrong character code for the operating system. While CHAR(10) is the standard for Line Feed (LF) used in Windows, older Mac versions or specific legacy files might require CHAR(13) (Carriage Return). If you see a small square symbol or a strange character instead of a line break, try switching the number inside the parentheses.
Users also frequently forget to turn on Wrap Text. Without this setting, Excel ignores the line break instruction and displays the result as one continuous string. If you are applying this to a large range of cells, remember to select the entire column before clicking Wrap Text to ensure consistency across your dataset.
Tips
To make your formulas easier to read and manage, you can combine the CHAR(10) method with the TEXTJOIN function in newer versions of Excel. Instead of writing multiple ampersands, you can use =TEXTJOIN(CHAR(10), TRUE, A2, B2, C2). This tells Excel to put a line break between every cell listed, and the "TRUE" argument tells it to ignore any empty cells, preventing unnecessary blank lines in your output.
If you need to add multiple line breaks for a larger gap between paragraphs, simply repeat the function. For example, & CHAR(10) & CHAR(10) & will create a double-space effect, effectively leaving one empty line between your blocks of text.
When working with dates or currency inside these formulas, the formatting is often lost. To keep the date looking like a date, wrap the cell reference in a TEXT function. For example: ="Date: " & TEXT(A2, "mm/dd/yyyy") & CHAR(10) & "Total: " & TEXT(B2, "$#,##0.00"). This ensures that the return doesn't just separate the data, but that the data remains professional and readable.
Troubleshooting
If the formula is correct and Wrap Text is enabled, but the line break still isn't appearing, check the cell alignment. Sometimes, if the cell is set to "Fill" or a specific horizontal alignment, the wrapping behavior can act unexpectedly. Set the horizontal alignment to "Left" or "General" to reset the behavior.
If you see the literal text "CHAR(10)" appearing in your cell instead of a line break, check if the cell is formatted as "Text". If a cell is formatted as Text before you type the formula, Excel treats everything you enter as a literal string and will not execute the calculation. To fix this, change the cell format to "General" via the Home tab, then click into the formula bar and press Enter again to force the formula to trigger.
In cases where you are exporting the Excel sheet to a CSV file, be aware that CSVs are plain text files. While the line breaks may exist in the data, they may not render correctly when opened in a basic text editor like Notepad. However, they will typically be preserved if the CSV is re-imported into Excel or another spreadsheet software.
Frequently Asked Questions
Can I use Alt+Enter inside a formula?
No. Alt+Enter is used to insert a manual line break when you are typing static text directly into a cell. When you are writing a formula, Alt+Enter only moves the cursor to a new line within the formula bar to make the code easier to read; it does not insert a line break into the actual result of the formula.
Does CHAR(10) work in Google Sheets?
Yes, Google Sheets uses the same logic as Excel for Windows. You can use & CHAR(10) & to create line breaks within a formula, and you must also enable "Wrap" in the toolbar for the effect to be visible.
Why does my row height not adjust automatically?
Excel's "AutoFit Row Height" feature sometimes fails when Wrap Text is applied via a formula. To fix this, select the row, go to the Home tab, click Format (in the Cells group), and select "AutoFit Row Height".
Can I use this to create a mailing list layout?
Yes, this is a very common use case. By combining a name, address, and city using CHAR(10), you can create a single cell that looks like a mailing label, which can then be copied or linked to other parts of your workbook.
Will this work in Excel Online?
Yes, the CHAR(10) function and the Wrap Text setting are fully supported in the web-based version of Excel, though the interface for the Wrap Text button may look slightly different than the desktop version.