Often, we insert Carriage Return in Excel formula concatenate to make our data more comprehensible. We can insert a Carriage Return in formula concatenate using various functions such as CONCATENATE, CHAR, TEXTJOIN as well as VBA Macro, Ampersand (&), and Power Query features.
Let’s say we have Last Name, First Name, Business Address, City, State, and Zip Code columns in a dataset. And we want to insert a Carriage Return in concatenate formulas’ outcomes. In this article, we demonstrate the ways to insert carriage return in Excel formula concatenate.
Download Excel Workbook
What is Carriage Return?
In Excel, Carriage Return is an operation to move part of the cell contents to a new line within the cell. In cases, when multiple cell entries get concatenated in one cell, the entire cell content becomes too lengthy to display comfortably. As a result, carriage returns are inserted to push the cell contents to a new line under the previous one.
6 Easy Ways to Insert Carriage Return in Excel Formula to Concatenate
Method 1: Using Ampersand Operator and CHAR Functions Insert Carriage Return in Excel Formula to Concatenate
In order to make a Name and Address column, we have to concatenate multiple columns entries into one. To concatenate multiple entries, we use Ampersand (&). But as we want to insert a Carriage Return into the formula, the CHAR function is used. We know CHAR (10) is the character code for Line Break.
Step 1: Type the following formula into any adjacent cell (i.e., H5).
It joins the full address with Comma Character (i.e., CHAR (44)) (i.e., D5&CHAR (44) &E5&CHAR (44) &F5&CHAR (44) &G5).
At last, both Name and Address portions get separated by a Line Break or Carriage Return (i.e., CHAR (10)).
➤ After inserting the formula, press ENTER. You see no carriage return among the individual entries as depicted in the image below.
➤ Selecting Wrap Text makes the cell contents appear in the desired format. Now, you can see H5 cell contents appear with a carriage return.
Step 3: Drag the Fill Handle to appear all the cell contents in the desired format as shown in the picture below.
Method 2: CONCATENATE and CHAR Functions to Insert Carriage Return
The CONCATENATE function also joins multiple entries in one cell. In this section, we use the CONCATENATE function to concatenate the individual cell entries. But in order to place a carriage return, we have to infuse the CHAR function in the CONCATENATE formula.
Step 1: Paste the following formula in any blank cell (i.e., H5).
The joining pattern for the entries is similar as we explain in Step 1 of Method 1.
Step 2: Following the formula insertion, repeat Step 2 of Method 1 to wrap the texts and use the Fill Handle to display all the joined contents with a carriage return.
Method 3: TEXTJOIN Function to Places Carriage Return in Concatenated Texts
Similar to Method 1 and 2, the TEXTJOIN function concatenates multiple cell entries and displays them in one cell. The syntax of the TEXTJOIN function is
TEXTJOIN (delimiter, ignore_empty, text1, [text2], ...)
delimiter; the separator between texts.
ignore_empty; offer two options whether it ignores the blank cells or not. TRUE for ignoring the blank or empty cell and FALSE otherwise.
Step 1: Write the following formula in any adjacent blank cell (i.e., H5).
Inside the formula,
CHAR (10); is the Carriage Return delimiter.
FALSE; is the ignore_empty option.
B5&CHAR (32) &C5 = text1
D5&CHAR (44) & E5&CHAR (44) &F5&CHAR (44) &G5 = text2.
Step 2: Hit the ENTER key then Drag the Fill Handle to apply the formula and cell format to other cells.
Read More: Combine Text in Excel (8 Suitable Ways)
- How to Concatenate Columns in Excel (8 Simple Methods)
- [Fixed!] Carriage Return Not Working in Excel (2 Solutions)
- Concatenate Not Working in Excel (3 Reasons with Solutions)
- Replace Text with Carriage Return in Excel (4 Smooth Approaches)
- How to Concatenate Apostrophe in Excel (6 Easy Ways)
Method 4: Keyboard Shortcuts to Insert Carriage Return
Suppose we want to concatenate the cell entries without inserting the Carriage Return. We simply use the Ampersand (&) to join those entries.
In Method 1, we demonstrate how we can transform several texts into one lengthy text value. After joining the texts, we can insert them as values by getting rid of the formula. Then we can place the Carriage Return in the converted cells using Keyboard Shortcuts (i.e., ALT+ENTER).
Step 1: Previously you used Ampersand to concatenate the texts. Similarly use the Ampersand formula to concatenate the texts.
The above formula places Space between First and Last Names (i.e., B5&CHAR (32) &C5). Then the formula places Comma between different cell entries while joining them (i.e., D5&CHAR (44) &E5&CHAR (44) &F5&CHAR (44) &G5).
Step 2: In order to insert the joined text values as just values, Right Click on the text values > Select Copy (from the Context Menu options).
Step 3: Again, after Selecting the entire range Right Click on them. Select the Paste Options Value above the Paste Special feature.
Step 4: Pasting the texts as value removes the formula that constitutes them. You can see from the below picture that all the joined texts are in plain text. Place the Cursor anywhere within the joined text string (i.e., after the Last and First Name). Press ALT+ENTER altogether.
➤ Pressing ALT+ENTER inserts a line break or you call a carriage return after Full Name. This carriage return separates the address with a line break making the cell content more user-friendly.
➤ Drag the Fill Handle to impose the carriage return in all the cells.
Method 5: VBA Macro Custom Function to Join the Entries with Carriage Return
Excel VBA Macros are very efficient in achieving desired outcomes. In this method, we demonstrate a custom function generated by a VBA Macro Code to insert a carriage return within a concatenated text string. Therefore, we slightly modify the dataset combining Name and Address into two separate cells. Using a custom function, we try to concatenate the cell entries into one.
Step 1: Press ALT+F11 to open the Microsoft Visual Basic window. In the window, Select Insert (from the Toolbar) > Choose Module. The Module window appears.
Step 2: In the Module window, Paste the following VBA Macro Code to generate a custom formula.
Function CrgRtrn(name As String, address As String) As String CrgRtrn = name & Chr(10) & address End Function
The macro code generates a custom function that has a syntax of name & Chr(10) & address. So, the custom function (i.e., CrgRtrn) inserts a carriage return as instructed in its syntax.
Step 3: By returning to the worksheet, Type =Cr… you see the custom function appears below the Formula bar. Double Click on the function.
Step 4: Assign the cell reference as depicted in the following picture. As a result, the formula becomes the below one.
In the formula, B5 and C5 are two strings separated by a carriage return or line break character (i.e., CHAR (10)).
Step 5: Use the ENTER key to concatenate the texts. However, the carriage return doesn’t show up similar to the picture below.
Step 6: To display the carriage return, Select the Wrap Text option from the Home tab. Right then the carriage return appears as shown in the image below.
➤ Drag the Fill Handle to display the carriage return in all the cells.
Method 6: Power Query Combines Entries with a Carriage Return Delimiter
Excel Power Query is a strong tool to deal with data. We can use a custom column formula to insert carriage return in our dataset.
Step 1: Select the range in where you want to place the carriage return. Afterward, Go to the Data tab > Select From Table/Range option (in the Get & Transform Data section).
Step 2: In case your dataset is not in a Table format, the selection converts it into a Table. Click on OK in the Create Table dialog box.
Step 3: The Power Query Editor window appears. In the window, Select Add Column (from the ribbon) > Choose Custom Column (from the General section).
Step 4: The Custom Column command box appears. In the box, Give a reasonable name to the new column. Insert the available columns in the Custom Column formula box and join them with an Ampersand.
It inserts a custom column beside the existing columns concatenating the text within both columns.
Step 5: In the Custom Column formula box, Paste the following formula to place a carriage return between the Name and Address columns.
= Table.AddColumn(#"Changed Type", "Address Labels", each Text.Combine(Record.ToList(_),"#(lf)"))
The pasted formula combines records with a delimiter “#(lf)” that inserts a carriage return.
Step 6: Apply the ENTER key and you see all the entries in the Custom Column get carriage return inserted.
Step 7: Now, we have to load the entries in an Excel worksheet. Go to Home tab > Select Close & Load (from the Close & Load section).
➤ The Close & Load command inserts the entries in a new Excel worksheet as shown in the following screenshot. But there is no carriage return inserted.
Step 8: To visible the line break or carriage return, Select the entire custom column range and apply Wrap Text. In a moment all the entries get separated by the desired format (i.e., Carriage Return between Name and Address).
In this article, we demonstrate ways to insert carriage return in Excel formula to concatenate operations. To achieve this format, we use functions like CONCATENATE, CHAR, TEXTJOIN. Other Excel features such as Ampersand, VBA Macros, and Power Query are also discussed in this article. You can use any of these methods to get the format in shape. Hope these above-described methods are efficient enough to fulfill your demand. Comment, if you have further inquiries or anything to add.
- Concatenate Numbers with Leading Zeros in Excel (6 Methods)
- How to Replace Carriage Return with Comma in Excel (3 Ways)
- Concatenate Two Columns in Excel with Hyphen (9 Quick Ways)
- Remove Carriage Return in Excel with Text to Columns
- Concatenate Date That Doesn’t Become Number in Excel (5 Ways)
- How to Concatenate and Keep Currency Format in Excel (3 Methods)
- How to Bold Text in Concatenate Formula in Excel (2 Methods)