Excel Carriage Return (Table of Contents)
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 which can help us in such situations and eventually saves us as well. This article will see how a carriage return can be inserted within the cell using the formula. It is one way to push some text into the next line (it breaks 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 within 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:
We wanted to add line breaks at the specific position within the text. We have various ways to add the carriage return within the text using the formula or using 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 in 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: Now, hold the Alt key and then 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 by far 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.
Well, it is obvious that we need to use the concatenate operator to combine the data from different cells. However, it does not make any sense to add the line breaks using the Alt + Enter method when we are using a formula to combine the cells. Therefore, we will use the CHAR function, which allows you to add the 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 together, you can see there is 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 need to 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 given text. Numeric value 10 specifies the line break/carriage return in Excel.
Step 4: Now, select the cell E2 and click on Wrap Text present under the Alignment group under the Home tab to make that layout as we are expecting it to be.
This is how we can add the carriage return under Excel using a keyboard shortcut as well as using 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 and 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 the 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 also have seen 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.
- CHAR(10) allows you to add the carriage return within a cell using the formula. Numeric value 10 in Excel specifies the carriage return/line break.
- We can use the TRIM or SUBSTITUTE function in Excel to remove carriage returns from a cell.
This is a guide to Carriage Return in Excel. Here we discuss How to Insert Carriage Return in Excel along with practical examples and a downloadable excel template. You can also go through our other suggested articles –