Friday, January 25, 2008

How to concatenate data easily in excel?

First of all, what the heck is concatenation anyway? We think of Excel as being only able to perform arithmetic functions on data. Wrong. Excel has many features that allow you to work with text data as well.

In Excel, the Concatenate function allows you to join 2 or more strings together.

The syntax for the Concatenate function is:

Concatenate( text1, text2, ... text_n )

There can be up to 30 strings that are joined together.

Let me tell you the easiest way to CONCATENATE:

Let's take a look at an example:

I have written "alpha" in cell number A1 ane "bet" in cell A2

Based on the Excel spreadsheet description above:

=Concatenate(A1, A2) would return "Alphabet"
=Concatenate("Tech on the ", "Net") would return "Tech on the Net"
=Concatenate(A1, "bet soup") would return "Alphabet soup"
whatever is written in the inverted commas will be shown as it is.

There is another way to use concatenate function: *psst* the hard way:

Lets suppose that cell A1 contains Mary and B1 contains Brown

Another cell, say, C1 contains the concatenation formula: =A1&B1

F132 will display: MaryBrown

The simple definition was to add two or more cells together that contained text. To add to the definition, you can add text cells and/or text strings together.

The next logical question in the MaryBrown case is that you probably want a space to separate the first and last name. In English you are saying add A1 to a specific text character not found in the cells, and then add B1 to that. The specific character just happens to be a space. So here it is:

The new concatenated formula: =A1&" "&B1

The concatenated cell with the space: Mary Brown

Now, let's add the prefix "Ms" in front of Mary's name. Since "Ms" is not in cell, we'll attach the text string in front of the concatenated name.

The completed concatenated formula: ="Ms "&A1&" "&B1

The cell would now display Ms Mary Brown

Note that when concatenating "Ms" that the formula still starts with a equal (=) sign, the text is surrounded by double quotes and the space needed to separate Ms from Mary was included inside the double quotes.


Now, I think the concatenate ghost is running far far away from you =D

No comments: