Concatenation in Excel (Table of Contents)
- Concatenation in Excel
- How to Use Concatenation in Excel?
- Printing Year, Month and Date Using the Concatenate Formula
- Concatenate using “&” Operator
Concatenation in Excel
Concatenation is an operation performed in excel for adding or merging the data from two or more cells and placing it in one cell. To be clear, adding means not a mathematical operation; it is only the 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 a 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 in 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 the portal to excel, it comes like each name filled in separate cells like below.
We need to add the two names and fill them under the column named “Full Name”.
Observe the formula; it is concatenating A2 and B2; hence, the result is merging first and last names.
But, there is no space between the first name and last name if we observe the results. 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.
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 it with rows of data.
If we want to add the space between each word, use space with double quotes in between each cell’s address.
Printing Year, Month, and Date Using the Concatenate Formula
We will see each one by one; let’s start with the year. If you want to print the current year with a concatenation of other cell data, give the formula below.
The current year is a string hence kept in double quotes. Today function will give the current date, but we only need the year alone; hence we given the year format in double quotes and then convert the year into text format using the 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 the Concat function, we can use the “&” 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 an & symbol after the cell address C3 and maintain the space between the two names; we were given space between double quotes as similar 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 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 and concatenates 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. Please find the below screenshot, which we need to join or concatenate those texts using TEXTJOIN.
First, we need to give a 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. The second is for ignorance of empty spaces; if we do not want empty space cells to include our text, it 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 the comma.
If we give the delimiter like a 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 a downloadable excel template. You can also go through our other suggested articles –