Updated May 12, 2023
Concatenating Columns in Excel
This article provides insight into the operating Concatenate columns in Excel. We frequently come up with a situation where data is stored in multiple columns, and all we want is to store it in one column, row by row.
For example, you have a full-view table that contains different columns named Emp ID, First Name, Last Name, Address, City, Postal Code, and Salary. You wanted to combine the First Name and Last Name with Space as a separator between them, or you wanted to combine the Address along with City and Postal Code details so that you can have the Address in one single cell, which could be printed on the envelope in case you send them a letter.
What can you do in such scenarios? If you are not sure what to do in such cases, this article is for you.
This article discusses how we can concatenate the data from two or more columns using concatenate function and the ampersand (&) operator.
As the word itself mean as per the English literature (Concatenate = link (things) together in a chain or series), Concatenation is a process in Excel that allows you to join two or more columns containing strings cell by cell (row by row more precisely) with the help of certain separators/delimiters.
How to Concatenate Columns in Excel?
We have two ways to excel to concatenate the strings.
- Using CONCATENATE() Function
- Ampersand (&) Operator
We will see both methods of Concatenating Columns in Excel with some examples.
Example #1
Concatenating two or more cells using CONCATENATE() Function –
The syntax for CONCATENATE in Excel is :
=CONCATENATE(text1, [text2], [text3], …). Where text is, most of the time, cell reference value.
We can see that apart from the first argument, the rest are enclosed in squared brackets. It’s an indication that these arguments are optional.
Let’s look at some of the examples!
Suppose we have two columns containing the First name and Last Name of the Employee in each respective column (B and C).
We can concatenate the two values (B2 and C2) under column D (named as Full Name) as follows:
=CONCATENATE(B2, C2)
See the image below.
However, you can see that the First Name and Last Name are combined without any delimiter/separator. Please see the below image for realization.
There is no separator between First Name and Last Name in column D (Full Name).
We would like to have space between First Name and Last Name.
Fortunately, CONCATENATE in Excel allows us to add delimiters and separators to customize the view.
See the below formula:
=CONCATENATE(B2, “ ”, C2)
You can easily recognize the difference between the previous formula and this one. Space is included within quotations to add space between the First and Last Names.
The result will be:
Note: We can use different delimiters within the CONCATENATE() function. Ex. The comma (“,”), hyphen (“-“), forward or backward slash, the asterisk (*), etc.
As we have come up with the solution for concatenating two cells, let’s think of a broader picture and combine two columns. It’s just as simple as dragging the notification panel down of your smartphone.
You need to drag the fill handle down so that formula in D2 gets copied and pasted into subsequent cells.
Easy looking, right?
There is another method to concatenate two or more than two columns in Excel. Let’s have a look, and it looks easier.
Example #2
Concatenating two or more cells using the ampersand (&) operator –
Ampersand (&) operator can also concatenate two or more cells in Excel. It works as same as CONCATENATE() function. This operator seems handier, as lazy people like me would like to type “&” other than CONCATENATE().
We will try to concatenate the same columns using the ampersand operator with the below syntax:
In cell D2, input the formula: =B2&C2.
It will give you the following output:
The result will be:
It is ideal to have space between First Name and Last Name.
Similarly to the concatenating function, you can add a separator/delimiter while using the ampersand operator to concatenate two or more columns.
In cell D2, replace the previous formula with the new one and see the results: = B2&” &C2.
We can drag the fill handle or use Ctrl + D (if there are no hidden cells between) to apply the formula to the entire column.
Easier to type & than CONCATENATE(), right?
Example #3
Concatenating two or more strings with Line Breaks
More often, you use a separator/delimiter like a comma(,), space, forward/backward slashes (when you’ve to concatenate dates), an asterisk(“*”), etc., to connect two or more strings. However, what if you have address details such as Street, City, and Postal Code in different columns, and you wanted to concatenate the same with line breaks so that the output should look like this:
We can’t add a line break as a simple delimiter(like a comma, space, etc.) in the CONCATENATE () Excel formula. Therefore, we need to use special function CHAR() to provide ASCII code for line breaks (ASCII code represents English letters, with each letter assigned a unique number between 0 to 127. For line breaks, the ASCII code is 10). Please note that these codes are compatible with the Windows system.
Let’s have a look at an example:
We have 3 different columns containing address information. Column A (Street), column B (City), and column C (Postal Code).
Let’s rename column D as Address and type the following formula under cell D2:
=CONCATENATE(A2, CHAR(10) , B2 , CHAR(10) , C2)
It gives the following result:
You can drag the formula to copy and apply it to all cells.
The result will look like this:
Things to Remember
- At least one text argument is required for CONCATENATE() function in Excel.
- CONCATENATE() formula has a limit of 255 strings (6 equivalent to 8,192 characters). You can’t exceed that limit in a single CONCATENATE() formula.
- The CONCATENATE() function always gives a string output no matter the input data type. Although your input data is Numeric, the output will always be a string.
- Arrays cannot be recognized by the CONCATENATE() function. Each cell reference needed to be provided separately. Having said that, =CONCATENATE(B2:C2) cannot be used instead of =CONCATENATE(B2, C2).
- If at least one of the arguments is not right or invalid in CONCATENATE() function, then Excel will shoot an #VALUE! Error towards the cell.
- #NAME? An error appears in CONCATENATE() function when quotations are missing while you are concatenating two or more Text values.
- Last and most important, if you are using Excel 2016 or above version, you should use the CONCAT() function instead of CONCATENATE(), as the latter is replaced by the successor and is supposed to be there in all upcoming Excel versions. CONCATENATE() is still there for compatibility with previous Excel versions, but Microsoft doesn’t assure whether it will be there in upcoming Excel versions.
Recommended Articles
This has been a guide to Concatenate Columns in Excel. Here we discussed Concatenate columns in Excel and How to use Concatenate Columns in Excel using different Excel methods, practical examples, and a downloadable Excel template. You can also go through our other suggested articles –