Concatenation in Excel (Table of Contents)
Concatenation in Excel
Concatenation is an operation that is performed in excel for adding or merging the data from two or more cells and place it in one cell. To be clear adding means, not a mathematical operation it is only physical adding of data. Suppose if we add 1 and 2 it will give the result as 12 but not 3. We will see a few examples for better understanding.
Syntax of concatenation:
How to Use Concatenation in Excel?
To understand concatenate in excel we have few examples as explained below.
Consider a job portal, most of us filled details in the job portal. While updating there are two fields for a name like first name and last name. So, when the data is exported from portal to excel it comes like each name filled in separate cells like below.
Now we need to add the two names and should fill under the column name “Full Name”.
Observe the formula it is concatenating A2 and B2 hence the result is merging of first name and last name.
But, if we observe the results there is no space between the first name and last name. We can achieve the space between the first name and last name in a very easy way. We just need to add an empty space with double quotes that will create space between two names as shown below.
4.9 (2,645 ratings)
Suppose if we want to add “Mr” before these names then we can do that also. Add “Mr” before C2 in the formula.
then it will give the results including “Mr” at the beginning of the name.
Observe how we got the required results. If we observe the formula there is a space after “Mr” to create a space between “Mr” and first name in the results. If we did not give the space, then it will merge with the first name.
In case, if we want to concatenate multiple cells we can give the range of those cells. Consider we have data in contiguous cells and we want to concatenate.
Below is the data available from cells C3 to G3.
Now under “full string” we need to join the data of all these cells.
Observe the formula instead of mentioning every cell address we can give the cell range from C3 to G3. But, in this type of concatenation, we cannot give any additional space in the formula to create a space between data items.
Up to now, we have seen how to concatenate the rows data now we will see how to concatenate the column data. Below is the example table that we can use for column concatenation.
We can apply the formula as simple as how we applied with rows data.
If we want to add the space between each word use space with double quotes in between the address of each cell.
Printing Year, Month and Date Using the Concatenate Formula
We will see one by one by let’s start with the year. Suppose if you want to print the current year with a concatenation of other cells data then give the formula as below.
The current year is a string hence kept in double quotes. Today function will give the current date, but we only need year alone hence we given year format in double quotes and then convert the year into text format using text function. This is how we can print the year in concatenate function. Similarly, we can print the month and date also.
To print the month in text format, give format as “mmm”.
If we want to print the month in number format.
If we want to print the complete date, then input the formula as below. The data format is entirely our wish if we want to print the first year we can print it.
Concatenate using “&” Operator
Instead of using Concat function we can use “&” operator also for concatenation. Now we will see a few Examples of how to perform concatenation using “&”.
Consider the below Example Rajesh and Kumar are available in two different cells now using & we will concatenate.
We have to use & symbol before and after the cell address.
Here we can observe there is an & symbol after the cell address C3 and maintain the space between the two names we given space between double quotes as similar as to how we have given in concatenate function. After space one more time we used the & symbol.
If we want to add the “-“ in between the two names we can use the “-“ symbol in the place of space.
Below are the screenshots for reference.
Date Format Using “&” Symbol
It is as similar to the concatenate function. If we want to print the current day, as to how we use today function similarly takes the today function and from that take a day in text format and concatenate with any text or cell address.
Text join is another function that we can use for joining the texts.
Syntax of TEXTJOIN is as below:
Text join has some other features, in addition, to concatenate that we can give the delimiter and we can ignore empty spaces when we select a range of cells.
We will see one example for a better understanding of this TEXTJOIN() function. Find the below screenshot which we need to join or concatenate those texts using TEXTJOIN.
First, we need to give delimiter which means how we want to separate each text whether space, comma, and semicolon, etc. Here we want space between each word hence we will give a space between two double quotes in the place of delimiter. Second is for ignorance of empty spaces if we do not want empty space cells to include our text gives “True” otherwise “false” and finally gives the range of cells which we want to join.
The result is as below.
In the below example we will give the delimiter as comma.
If we give the delimiter as comma then the result will be as below.
Things to Remember About Concatenation in Excel
- CONCAT and TEXTJOIN are the latest functions that started after EXCEL in 2016.
- CONCATENATION function also for joining the strings however it will give the results in text format only.
- CONCATENATION function will not allow the range of cells like A1: A3 instead we should give as A1, A2, A3.
This has been a guide to Concatenation in Excel. Here we discussed How to use Concatenation in Excel along with practical examples and downloadable excel template. You can also go through our other suggested articles –