Professional Documents
Culture Documents
columns
ablebits.com/office-addins-blog/2015/07/15/excel-concatenate-strings-cells-columns
In your Excel workbooks, the data is not always structured according to your needs. Often
you may want to split the content of one cell into individual cells, or do the opposite -
combine data from two or more columns into a single column. Common examples that
require concatenation in Excel are joining names and address parts, combining text with a
formula-driven value, displaying dates and times in the desired format, to name a few.
In this tutorial, we are going to explore various techniques of Excel string concatenation so
that you can choose the method best suited for your worksheets.
Merge cells
Concatenate cells' values
When you merge cells, you "physically" merge two or more cells into a single cell. As a
result, you have one larger cell that is displayed across multiple rows and/or columns in
your worksheet.
When you concatenate cells in Excel, you combine only the contents of those cells. In other
words, concatenation in Excel is the process of joining two or more values together. This
method is often used to combine a few pieces of text that reside in different cells
(technically, these are called text strings or simply strings) or insert a formula-calculated
value in the middle of some text.
The following screenshot demonstrates the difference between these two methods:
1/13
Merging cells in Excel is the subject of our next article, and in this tutorial we will tackle two
essential ways to concatenate strings in Excel - by using the CONCATENATE function and
the Excel & operator.
CONCATENATE(text1, [text2], …)
Below you will find a few examples of using the CONCATENATE function in Excel.
Note. In Excel 2016, Excel 2019, Excel Online and Excel Mobile, CONCATENATE is replaced
with the CONCAT function, which has exactly the same syntax. Although the
CONCATENATE function is kept for backward compatibility, it is recommended to use
CONCAT instead because Microsoft does not give any promises that CONCATENATE will
be available in future versions of Excel.
=CONCATENATE(A1, B1)
Please note that the values will be knit together without any delimiter, as in row 2 in the
screenshot below.
To separate the values with a space, enter " " in the second argument, as in row 3 in the
screenshot below.
To separate the concatenated values with other delimiters such as a comma, space or
slash, please see Excel CONCATENATE formulas with special characters .
Naturally, you can add a text string in the beginning or in the middle of your Concatenate
formula as well:
A space (" ") is added in between the combined values, so that the result displays as
"Project 1" rather than "Project1".
For example, you can use the following formula to return the current date:
As demonstrated in the screenshot below, the CONCATENATE function and "&" operator
return identical results:
The only essential difference between CONCATENATE and "&" operator is the 255 strings
limit of the Excel CONCATENATE function and no such limitations when using the
ampersand. Other than that, there is no difference between these two concatenation
methods, nor is there any speed difference between the CONCATENATE and "&" formulas.
And since 255 is a really big number and in real-life tasks someone will hardly ever need to
combine that many strings, the difference boils down to the comfort and ease of use. Some
users find CONCATENATE formulas easier to read, I personally prefer using the "&" method.
So, simply stick to the concatenation technique that you feel more comfortable with.
The following screenshot demonstrates how the results may look like:
A problem is that you cannot simply type a line break in the formula like a usual character,
and therefore a special CHAR function is needed to supply the corresponding ASCII code to
the concatenation formula:
5/13
On Windows, use CHAR(10) where 10 is the ASCII code for Line feed.
On the Mac system, use CHAR(13) where 13 is the ASCII code for Carriage return.
In this example, we have the address pieces in columns A through F, and we are putting
them together in column G by using the concatenation operator "&". The merged values are
separated with a comma (", "), space (" ") and a line break CHAR(10):
=A2 & " " & B2 & CHAR(10) & C2 & CHAR(10) & D2 & ", " & E2 & " " & F2
Note. When using line breaks to separate the concatenated values, you must have the
"Wrap text" option enabled for the result to display correctly. To do this, press Ctrl + 1 to
open the Format Cells dialog, switch to the Alignment tab and check the Wrap text box.
In the same manner, you can separate concatenated strings with other characters such as:
Either way, all four of the below formulas yield identical results:
6/13
How to concatenate columns in Excel
In order to concatenate two or more columns in Excel, you just enter a usual concatenation
formula in the first cell, and then copy it down to other cells by dragging the fill handle (the
small square that appears in the lower right hand corner of the selected cell).
For example, to concatenate two columns (column A and B) separating the values with a
space, you enter the following formula in cell C2, and then copy it down to other cells.
When you are dragging the fill handle to copy the formula, the mouse pointer changes to a
cross, as shown in the screenshot below:
Tip. A quick way to copy the formula down to other cells in the column is to select the cell
with the formula and double-click the fill handle .
Please note that Microsoft Excel determines how far to copy cells after the fill handle
double click based on the cells referred to by your formula. If there happen to be empty
cells in your table, say cell A6 and B6 were blank in this example, the formula would be
copied up to row 5 only. In this case, you would need to drag the fill handle down manually
to concatenate the entire columns.
7/13
Combining values from multiple cells might take some effort because the Excel
CONCATENATE function does not accept arrays and requires a single cell reference in
each argument.
To concatenate several cells, say A1 to A4, you need either of the following formulas:
When joining a fairly small range, it's no big deal to enter all the references in the formula
bar. A large range would be tedious to add, typing each cell reference manually. Below you
will find 3 methods of quick range concatenation in Excel.
Note. When using this method you must click each individual cell. Selecting a range with
the mouse would add an array to the formula, which the CONCATENATE function does not
accept.
Select the cell where you want to output the concatenated range.
8/13
Enter the TRANSPOSE formula in that cell, =TRANSPOSE(A1:A10) in this example.
In the formula bar, press F9 to replace the formula with calculated values.
Delete the curly braces that turn a usual Excel formula into an array formula. As a
result, you will have all the cells references to be included in your concatenation
formula.
In the first argument (value), you supply a number or date to be converted to text, or a
reference to the cell containing a numeric value.
9/13
In the second argument (format_text), you enter the desired format using the codes
that the TEXT function can understand.
We have already discussed one such formula in the beginning of this tutorial that
concatenates text and date.
I will remind you that when combining a text string and date, you have to use the TEXT
function to display the date in the desired format. For example:
or
A few more formula examples that concatenate a text value and number follow below:
=A2 & " " & TEXT(B2, "$#,#0.00") - display the number with 2 decimal places and the
$ sign.
=A2 & " " & TEXT(B2, "0.#") - does not display extra zeros and the $ sign.
=A2 & " " & TEXT(B2, "# ?/???") - display the number as a fraction.
You can find the detailed steps illustrated with formula examples and screenshots in the
How to split cells in Excel tutorial.
11/13
Join rows column-by-column
To combine data in each individual row, column-by-column, you choose to merge Rows,
select the delimiter you want (line break in this example), configure other settings the way
you want and hit the Merge button. The result may look similar to this:
12/13
To check how the Merge Cells add-in will cope with your data sets, you are welcome to
download a fully functional trial version. And if you are happy with the result, you may want
to buy helpful tool as a separate product or as part of our Ultimate Suite for Excel, which
includes 60+ other time-saving tools for most common Excel tasks. Either way, we will
happily offer you the 15% off coupon code that we've created especially for our blog
readers: AB14-BlogSpo.
If someone wants to examine the formulas discussed in this tutorial more closely, the
Sample workbook with concatenation formulas is available for download. Thank you for
reading!
See also
13/13