Concatenate in excel

5
Concatenate in Excel – Explained Often the data in your spreadsheets is not according to your needs, so you may need to replace some strings , split some text or concatenate strings to format the data as per your needs. String concatenation is the process of joining two or more strings together. Excel gives you the capability of concatenating a series of strings. Mainly there are two ways to merge strings in Excel and in this tutorial I will be explaining both these methods with suitable examples: Method 1: Concatenate in Excel using the Concatenate Function: Excel has a predefined formula ‘Concatenate’, the job of this function is to join multiple strings that are passed to it as arguments. The joined items can be text, numbers, cell references or a combination of these. Syntax of Concatenate: The syntax of this function is as follows: =Concatenate(text_1, text_2, Text_N) Here ‘TEXT_1’, ‘TEXT_2’ and ‘TEXT_N’ are strings which are to be combined.

Transcript of Concatenate in excel

Page 1: Concatenate in excel

Concatenate in Excel – ExplainedOften the data in your spreadsheets is not according to your needs, so you may need to replace some strings, split some text or concatenate strings to format the data as per your needs. String concatenation is the process of joining two or more strings together. Excel gives you the capability of concatenating a series of strings.

Mainly there are two ways to merge strings in Excel and in this tutorial I will be explaining both these methods with suitable examples:

Method 1: Concatenate in Excel using the Concatenate Function:Excel has a predefined formula ‘Concatenate’, the job of this function is to join multiple strings that are passed to it as arguments.

The joined items can be text, numbers, cell references or a combination of these.

Syntax of Concatenate:

The syntax of this function is as follows:

=Concatenate(text_1, text_2, Text_N)

Here ‘TEXT_1’, ‘TEXT_2’ and ‘TEXT_N’ are strings which are to be combined.

Some Important points about Concatenate Function:

A single Concatenate formula can be used for concatenating 255 strings.

Concatenate formula requires at-least 1 string as argument, to work.

It results into a #VALUE! error if any one of the arguments is invalid. For example:

=CONCATENATE(A2:C2) results into an error.

Examples of Concatenate Function:1. In the below example we have a list of First and Last names.

Page 2: Concatenate in excel

Now if you wish to join the First name and Last name strings, then you can use this Function as:

=CONCATENATE(A2," ",B2)

Here, ‘A2’ is the person’s First name and ‘B2’ represents the Last name. While joining these two strings they should be separated by a space “ ” and that’s why in the formula we have used a blank space in between ‘A2’ and ‘B2’.

Note: Notice that concatenate formula doesn’t leaves space in between two words itself.

2. In the second example we will try to join the First Name and the Last Name along with the person’s Title.

Page 3: Concatenate in excel

Here, we have used a Concatenate Formula as: =CONCATENATE("Mr. ",A3," ",B3)

In this formula first of all we have used a hardcoded title “Mr. ” and then we are concatenating the First name and the Last name in the same way as we have done in the first example.

Method 2: Joining multiple string in Excel using “&” operator:Another way to merge strings in excel is by using “&” operator. Actually, this method can come very handy when you have to join only a few strings. But if you are planning to use this method for concatenating several strings, then it can be quite cumbersome as it doesn’t gives you the ease of actual Concatenate Function.

Syntax of combining strings using “&” operator:

=<Text_1>&<Text_2>&<Text_N>

Here, ‘Text_1’, ‘Text_2’ and ‘Text_N’ are text strings that are to be joined.

Example of Concatenating string with “&” operator:1. In the below example we will also try to merge a person’s first name and Last name using “&” operator.

Page 4: Concatenate in excel

Here, we will use a formula: =A4&" "&B4

‘A4’ cell contains the person’s First name

And ‘B4’ cell contains the person’s Last name

This formula is similar to: =CONCATENATE(A4," ",B4)

So, what’s the difference between Concatenate function and “&” Operator:As, such there is no difference between the results of Concatenate Formula and “&” operator. But one thing that differs is that Concatenate Function can only join up-to 255 strings however “&” operator doesn’t have any such limitations.

I personally think that 255 is a huge number and no one practically needs to merge 255 strings. So, the difference boils down to the ease of use. You should use the option with which you feel more comfortable.