"Concatenate" usually means to link something together in a series or a chain. This operation is used whenever you need to join text from multiple Google Sheets cells. This article collects the most popular and easy solutions to help you solve the concatenation puzzle. Show
However big your dataset is, you may come across the task of combining multiple cells in Google Sheets together. And I have no doubt you will want to not only keep all values from losing, but also add some commas, spaces, or other characters, or even separate those records with other text. Well, spreadsheets offer several tools for this task. Google Sheets CONCAT functionThe CONCAT function is a simplified version of Google Sheets CONCATENATE: =CONCAT(value1, value2) To join cells with this function, you need to list the required values:
To get one string from 2 text or numeric units, the formula will look like below, with each record in double-quotes:
In reality, your data is most likely already in cells. You can refer to those cells directly instead of putting down each number or text as an argument. So the real-data formula will be like this:
Tip. To copy your formula to the whole column, select the cell with the formula and double-click the little square at the bottom right corner of the cell. The entire column will be automatically filled with the formula, till the very end of the table. As you can see, the function is super simple, but it has major weak points:
CONCAT alternative: concatenation operator ampersand (&)There are lots of different operators for various purposes in formulas. Concatenation is not an exception. Using an ampersand character (&) in formulas instead of the CONCAT function will provide you with the same result:
But little do you know that this concatenation operator is more flexible. Here's what it can do:
If you still don't get the desired result with these options, there's one more function to try. How to use CONCATENATE in Google SheetsI believe the Google Sheets CONCATENATE function is the first one to use when it comes to appending several records together. CONCATENATE text strings and numbers in Google SheetsThe formula pattern consists of the following arguments: =CONCATENATE(string1, [string2, ...])
Note. The outcome record will consist of the strings in the order of their appearance in the formula. If I adapt the formula to my data, I will get this:
Or, since the function accepts ranges:
You can immediately notice the first advantage of Google Sheets CONCATENATE: it easily joins over two cells with both text and numbers. Google Sheets: concatenate strings with separatorsCombining cells in Google Sheets is half the work. But to make the result look pretty and readable, you should add some extra characters. If you keep the formula as is, it will just glue everything together: BonnieJacksonCA, BonnieJacksonIN, etc. But Google Sheets CONCATENATE takes characters as arguments, too. Thus, to add some separators for readability, mention them in double-quotes in the formula:
Here I want to concatenate A2 & B2 with space and
separate B2 from C2 with a comma and space: You are free to use almost any character in the function like this, yet a line break requires a different approach. Tip. In case there are empty cells in some of the columns you're merging, there's one more function you may be interested in. TEXTJOIN not simply merges cells in Google Sheets but ignores blanks:
Here's how it works:
Concatenate with line break in Google SheetsWhile it's obvious how to enter most delimiters to the function, you cannot type a line break the same way there. But luckily Google lets you play many different cards. There's a function that helps to get special characters – it's called CHAR. You see, each character has a place in the Unicode table. You just need to feed the ordinal number of the character from that table to the function and the latter will return the character itself. Here's a formula to get the line break:
Add it to the formula to concatenate with the line break in Google Sheets:
Combine date and time in Google SheetsIf you try to combine date and time in Google Sheets using one of the methods above, it won't work. Your spreadsheet will return numbers: To combine date and time in Google Sheets correctly, use the TEXT function: =TEXT(number, format)
Tip. In my example, I'm going to reference cells with dates and times, but you are free to use date/time units or even such functions as DATE or TIME directly in the formula.
Combine columns in Google SheetsWith slight adjustments, all the ways I mentioned are capable of merging columns in Google Sheets. Example 1. Google Sheets CONCATTo merge whole columns in Google Sheets with CONCAT, select the entire range that should contain the result (C2:C11 in my case) and enter your formula wrapping it in ARRAYFORMULA:
Note. You could use the CONCATENATE function, but it will join all records within one cell since it easily merges multiple cells and data ranges. Example 2. Concatenation operatorCreate array formulas to combine columns in Google Sheets using the ampersand and add separators at the same time:
This looks good, but I have to point out some major cons. If you have too many columns, enumerating them all can become a pain in the neck, especially if you accidentally skip/duplicate/mix up any characters. Also, if you decide to add more columns to the formula later, you'll have to edit each and every existing range in the formula manually. The next example solves these problems. Example 3. Google Sheets QUERYGoogle Sheets QUERY function is also suited to merge several columns in Google Sheets. Have a look:
You may think this strange formula is beyond your grasp, but let me lay its all pieces out for you:
Here are the perks of merging columns in Google Sheets using QUERY:
Concatenate and add text by positionYou already know that you can add missing text, numbers, and characters to your strings using the CONCATENATE function. Tip. See more formulas on that in this tutorial. But if there are too many records to join, any extra characters can extend your formula way beyond what you have planned. In cases like this, it's better to merge cells in Google Sheets as they are or use simple delimiters like space and add the text after that. A special tool of ours will help you. Add text by position inserts any chars and strings by the position you specify, no formulas are needed. Let me show you how it works. In the previous example QUERY joined names and phone numbers for me. But I'd like to add country abbreviations: (USA/CA) before phone numbers that start with +1 and UK before +44: Split cells in Google SheetsIf you combine cells in Google Sheets, chances are you'll need to split them back at some point. There are three ways to do that:
Tip. There's an option to extract data from Google Sheets cells rather than split the contents. How to merge cells in Google Sheets without formulasIf mastering different formulas is not part of your plan, you will benefit from our Merge Values add-on. The add-on quickly joins records in rows, columns, or the entire range of cells. Its options are crystal clear, and all you are to do is select the range and decide on how the result should look.
I hope by now you've decided which of the ways suits your case best. If you have any other methods in mind, please do share with us in the comments section below :) You may also be interested inWhat is the easiest way to combine two columns in Excel and Google Sheets?Combine Multiple Columns in Google Sheets into One Column. In the cell D2 insert the formula: =CONCATENATE(B2," ",C2). Press enter and drag the formula down to the other cells in the column by clicking and dragging the little “+” icon at the bottom-right of the cell.. Can you concatenate columns in Google Sheets?To use CONCAT in Google Sheets, you first need to select the cells or ranges of cells that you want to concatenate. Then, go to the "Formulas" tab and select "CONCATENATE" from the "Text" section. This will open a new dialog box in which you can input the cells or ranges of cells that you want to concatenate.
|