Updated June 8, 2023
What is Carriage Return in Excel?
The carriage return is a method in Excel that helps you add a line break within a single cell to add text as multiple lines within a single cell without consuming multiple lines of cells. We have carriage returns that can help us in such situations and eventually save us. Using the formula, This article will show how a carriage return can be inserted within the cell. It is one way to push some text into the next line (it breaks the line) in the same cell, which allows your data to have a decent view.
Examples of Carriage Return in Excel
In Excel, Carriage Returns allows you to wrap text within a cell or a merged set of cells. Let’s look at a few examples.
Suppose we have text data as shown below in cell A1 of the Excel sheet.
However, it seems lengthy and doesn’t look good. We wanted it to look like the one in the screenshot below:
For adding line breaks at the specific position within the text. We can add the carriage return within the text using the formula or the Alt + Enter keys on the keyboard.
We will see these two ways of adding carriage return inside a text within Excel. Let’s understand how to Insert the Carriage Return in Excel.
Example #1 – Insert Carriage Return using Keyboard Shortcuts
Suppose we have data as shown below in cell A1 of the worksheet. Where multiple lines are included within the same cell, and each line is separated with a comma.
Step 1: Press the F2 key to take the cell into edit mode and place the cursor at the place from where you wanted to break the line or the place after which you wanted the data to push on a new line.
Step 2: Hold the Alt key and press the Enter key to break the line at the point where we have placed the cursor.
Step 3: Now, again, place a cursor at the place where you wanted a line, a break, and the content to be moved to the next line. In this case, place a cursor before NY, or you can say after the second comma.
Step 4: Repeat Step no 2 to add a line break or carriage return after the second comma. The text now should look like the one below:
This is the simplest way to add the carriage return/line breaks within a cell inside Excel.
Example #2 – Insert Carriage Return in Excel using a Formula
Suppose we have data as shown below, where we have different fields stored in different columns, and we need to combine those in a single cell but with carriage return/line break.
We must use the concatenate operator to combine the data from different cells. However, adding the line breaks using the Alt + Enter method does not make sense when we use a formula to combine the cells. Therefore, we will use the CHAR function, which allows you to add special characters within the cells. Let’s see how this all goes in Excel.
Step 1: We all know how to concatenate the cells in Excel. Use concatenate operator (“&”) to concatenate the cells A2:D2 in cell E2.
If you press enter to see how the cells are combined, you can see no spacing after each cell value. We can add this using a concatenate operator under the same formula in cell E2.
Step 2: Use “”(single space) to add spacing after each cell value and use concatenate operator to combine it with the current formula combination under cell E2.
Step 3: Now, we must add the carriage returns after each cell value (i.e., after A2, B2, and C2). Use CHAR(10) under the previous formula and connect it with the old one after each cell using the concatenate operator.
The formula CHAR(10) allows the system to add the carriage return in the text. Numeric value 10 specifies the line break/carriage return in Excel.
Step 4: Now, select cell E2 and click on Wrap Text present under the Alignment group under the Home tab to make that layout as we expect.
We can add the carriage return under Excel using a keyboard shortcut and a Formula. Now, we will see how to remove Carriage Return from the cells.
Example #3 – How to Remove Carriage Return
If you are using Alt + Enter to add carriage return within a cell, you can remove those by using Excel Find and Replace tool.
- Select a cell within which you have carriage return/line break and Press Ctrl + H to open up Excel Find & Replace window.
- Under “Find What:” Press Ctrl + J from your keyboard to find the line break or carriage return present under the cell.
- Under “Replace with:“, you don’t need to do anything. Just hit the replace all button.
You can see the carriage return has been removed from the text.
If you have used a formula to insert carriage return within a cell, you can use two formulas to remove the same.
- In cell E4, use the formula as =TRIM(E2) to remove the carriage return from cell E2.
You can also use Excel’s substitute function to remove carriage returns from a formulated cell.
- In cell E5, use formula as =SUBSTITUTE(E2,CHAR(10), “”). This formula removes carriage return from cell E2.
This is it from this article, where we have seen how to add the carriage returns/line breaks in a text and various ways to remove carriage returns from a cell. Let’s wrap things up with some points to be remembered.
Things to Remember
- Carriage Return allows you to add the line break within a single cell.
- The formula CHAR(10) allows you to add the carriage return within a cell. Numeric value 10 in Excel specifies the carriage return/line break.
- We can use Excel’s TRIM or SUBSTITUTE function to remove carriage returns from a cell.
Recommended Articles
This is a guide to Carriage Return in Excel. Here we discuss How to Insert Carriage Returns in Excel, practical examples, and a downloadable Excel template. You can also go through our other suggested articles –