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 but only the physical addition of data. Suppose 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?
We have a few examples to understand concatenation in Excel, 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 and last names. So, when the data is exported from the portal to Excel, each name is filled in separate cells like below.
We must add and fill in the two names under the “Full Name” column.
Observe the formula; it is concatenating A2 and B2; hence, the result is merging first and last names.
We can achieve the space between the first name and last name in a very easy way. But, there is no space between the first and last names if we observe the results. As shown below, we need to add an empty space with double quotes to create space between two names.
Suppose 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 the first name in the results. The space will merge with the first name if we do not give the space.
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 simply as how we applied it with rows of data.
If we want to add 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 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’s function will give the current date, but we only need the year alone; hence we give 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 the format as “mmm”.
If we want to print the month in number format.
If we want to print the complete date, input the formula 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 for concatenation. Now we will see a few examples of concatenation using “&”.
Consider the below Example. Rajesh and Kumar are available in two different cells now using & we will concatenate them.
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 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 takes a day in text format and concatenates with any text or cell address.
Text join is another function that we can use for joining texts.
The 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 to understand this TEXTJOIN() function better. 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, semicolon, etc. Here we want space between each word; hence we will give a space between two double quotes in place of the delimiter. The second is 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 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 a comma, the result will be below.
Things to Remember about Concatenation in Excel
- Concat and TEXTJOIN are the latest functions that started after EXCEL in 2016.
- The concatenation function is also for joining the strings; however, it will only give the results in text format.
- The concatenation function will not allow the range of cells like A1: A3; instead, we should give A1, A2, and A3.
This has been a guide to Concatenation in Excel. Here we discussed How to use Concatenation in Excel, practical examples, and a downloadable Excel template. You can also go through our other suggested articles to learn more–
- Opposite of Concatenate in Excel
- CONCATENATE Function in Excel
- Concatenate Strings in Excel
- VBA Concatenate Strings