Tip: Other languages are Google-Translated. You can visit the English version of this link.
or

Register

or
0
0
0
s2sdefault

## How to combine cells into a cell with space, commas and semicolon in Excel?

When you combine the cells of a range into a single cell, the combined data may be separated by nothing. But if you want to separate them with specified marks, such as space, commas, semicolon or others, how can you do? This tutorial will introduce some cuts for you.

Merge row / column of cells into one cell with specified marks by formula

Merge row / column of cells into one cell with specified marks by Function

#### Merge row / column of cells into one cell with specified marks by formula

###### Amazing! Using Tabs in Excel like Firefox, Chrome, Internet Explore 10!

In Excel, you can use a formula to combine a row of cells or a column of cells into a single cell. Please do as follows:

Combine cells based on row or column into one with space

Step 1. Typing the formula = A1&" "&B1&" "&C1 into a blank cell, and press Enter button on the keyboard. See screenshot:

Step 2. Dragging the fill handle over the range that you want to apply this formula, all of the cells have been combined into a cell based on row values with spaces. See screenshot:

Tip: If you want to merge the cell values based on column, you just need to enter this formula = A1&" "&A2&" "&A3&" "&A4 in adjacent blank cell that you want to get the result. Then do as the above steps, you will get the following results:

Combine cells based on row or column into one with commas

Step 1. Typing the formula =A1&","&B1&","&C1 into a blank cell, and press Enter button on the keyboard. See screenshot:

Step 2. Dragging the fill handle over the range that you want to apply this formula, all of the cells in a row will be combined into a cell with commas. See screenshot:

Tip: You can also merge the column of cell values into one cell with commas, just type this formula =A1&","&A2&","&A3&””&A4.Then do with above steps.

Note: you can change "'," to meet your needs. For example, if you want to separate the data with semicolons, you can change "," to ";".

#### Merge row / column of cells into one cell with specified marks by Function

In Excel, you can also use function to combine cells of row or column into a single cell with spaces or specified marks.

1. Hold ALT button and press F11 on the keyboard to open a Microsoft Visual Basic for Application window.

2. Click Insert > Module, and copy the VBA into the module.

VBA: Combine cells based on row or column into one with commas:

```Function Combine(WorkRng As Range, Optional Sign As String = ",") As String
'Update 20130815
Dim Rng As Range
Dim OutStr As String
For Each Rng In WorkRng
If Rng.Text <> "," Then
OutStr = OutStr & Rng.Text & Sign
End If
Next
Combine = Left(OutStr, Len(OutStr) - 1)
End Function```

3. Typing formula =Combine(A1:C1) in a blank cell, and press Enter button in the keyboard, and the data in cell A1 to C1 will be merged into a cell and separated by commas. See screenshot:

4. Dragging the fill handle over the range that you want to apply this formula, all of the cells in the row will be combined into a cell with commas. See screenshot:

Tip: With above User Defined Function, you can also combine cell values based on column, you just need to enter this formula =Combine(A1:A4) after copying above code into the Module.

Note: You can change "," to meet your need. For example, if you want to merge cells into a cell with space, you can change "," to" ".

#### Merge row / column / range of cells into one cell with specified marks by Kutools for Excel

If formula and function are difficult for you, you can quickly combine cell values by row, column or a range into one single cell with Kutools for Excel's Combine function.

After installing Kutools for Excel, please do as below:

1. Select a range cell values that you want to combine into a cell.

2. Please apply Combine function by clicking Kutools > Combine. See screenshot:

3. And a dialog will be displayed, and then do as follows:

(1.) If you need to combine a range of cell data into one single cell, please do as this:

Check Combine into single cell in To combine selected cells according to following options section;

Select the separator you want to separate the combined data in Specify a separator section.

Then click OK or Apply button, and you will get the following result, see screenshot:

(2.) If you select Combine columns in the To combine selected cells according to following options section in the Combine Columns or Rows dialog, the data in each row will be merged into a single cell, do as follows:

Check Combine columns in the To combine selected cells according to following options section;

Select the separator you want to separate the combined data in Specify a separator section;

Select the place you want to put the result in from the drop-down box;

Select one type from the Options section.

Then click OK or Apply button, the values in each row will be merged. See screenshots:

(3.) And if you want to merge each column values to one cell with specific separator, please do as this:

Check Combine rows in the To combine selected cells according to following options section;

Specify a separator you want to separate the combined data in Specify a separator section;

Select the place you want to put the result in from the drop-down box;

Select one type from the Options section.

Then click OK or Apply button, the values in each column will be merged and they are separated by the specific marks. See screenshots:

Kutools for Excel's Combine function also can merge cells base on columns. Click here to know more about Combine.

### Recommended Productivity Tools

#### Office Tab

Bring handy tabs to Excel and other Office software, just like Chrome, Firefox and new Internet Explorer.

#### Kutools for Excel

Amazing! Increase your productivity in 5 minutes. Don't need any special skills, save two hours every day!

200 New Features for Excel, Make Excel Much Easy and Powerful:

• Merge Cell/Rows/Columns without Losing Data.
• Combine and Consolidate Multiple Sheets and Workbooks.
• Compare Ranges, Copy Multiple Ranges, Convert Text to Date, Unit and Currency Conversion.
• Count by Colors, Paging Subtotals, Advanced Sort and Super Filter,

Say something here...
symbols left.
###### or post as a guest, but your post won't be published automatically.
• To post as a guest, your comment is unpublished.
· 3 months ago
Working on trying to get your VBA code to work however I keep getting a #NAME? error. How do I fix this? I've used this code before and it worked wonderfully but now it gives me an error.
• To post as a guest, your comment is unpublished.
· 6 months ago
But it is not working for large data. I have around 50000 rows to combine in single cell.
• To post as a guest, your comment is unpublished.
· 1 years ago
415xxe 5687sdc sa4567
415xxe 5687sdc sa4567
415xxe 5687sdc sa4567
415xxe 5687sdc sa4567

I need to separate these in different columns and then put a comma behind the last column
• To post as a guest, your comment is unpublished.
· 1 years ago
The VBA code does not work

I get an error Microsoft Visual Basic for Applications - Compile error: Syntax error

then the line "If Rng.Text "," Then" is highlighted in blue and on the top highlighted in yellow it says this "function combine(workrng as range, optional sign as string = ",") as string

I am using excel 2016 on a pc
• To post as a guest, your comment is unpublished.
· 1 years ago
I genuinely enjoy studying on this website, it holds good content. Never fight an inanimate object. by P. J. O'Rourke. dfdkbafbadfkagdd