In Google Sheets, you have three different ways to write a formula combine two or more values using a comma. And in this tutorial, we will learn to write and understand all these formulas in detail.
Using Ampersand to Concatenate with a Comma
Let’s say you have values in two different cells and want to combine them in a single cell and add a comma between them.
- Enter equal to (=).
- Refer to the first cell (A1) with the value and enter the ampersand (&) operator.
- With double quotation marks, specify a comma and a space, like “, “.
- Refer to the second cell with the value and enter an ampersand again.
- In the end, hit enter to get the combined value.
=A1&", "&B1
Use CONCATENATE Function to Combine with a Comma
If you have a comma in a cell, you can use the CONCATENATE. In the below example, we have three cells with the values. Where in the second cell, we have a comma and a space.
Now to combine these values, you can use CONCATENATE function. Enter the function and refer to the range A1:A3.
When you hit enter, it returns the combined value in a single cell with a comma between.
Using TEXTJOIN to Combine Values from Multiple Cells with a Comma
Suppose you have multiple values and want to combine them with a comma. The best way is to use TEXTJOIN. Unlike the above two methods, TEXTJOIN allows you to define the delimiter once.
=TEXTJOIN(", ",TRUE,A1:A5)
As said, in TEXTJOIN, there is no need to repeatedly define the comma and a space with each value.