Log in
x
or
x
x
Register
x

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 / range of cells into one cell with specified marks by Kutools for Excelgood idea3


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


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.

Kutools for Excel, with more than 120 handy functions, makes your jobs easier. 

After installing Kutools for Excel, please do as below: (Free Download Kutools for Excel Now!)

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:

doc combine cells into one 1

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:

doc combine cells with commas13
doc-arrow-down

(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:

doc combine cells with commas14
doc-arrow-down

(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:

doc combine cells with commas15
doc-arrow-down

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


Relative articles:


Recommended Productivity Tools

Office Tab

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

Kutools for Excel

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

gold star1 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,
  • More Select/Insert/Delete/Text/Format/Link/Comment/Workbooks/Worksheets Tools...

Screen shot of Kutools for Excel

btn read more      btn download     btn purchase

Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Sagar · 1 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.
    susan · 8 months 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.
    Joe · 8 months 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.
    Smithc114 · 9 months ago
    I genuinely enjoy studying on this website, it holds good content. Never fight an inanimate object. by P. J. O'Rourke. dfdkbafbadfkagdd
  • To post as a guest, your comment is unpublished.
    Sandeep K · 10 months ago
    how to combine 2 cell with space in between with 2 independent cell format. Eg. If one cell is Red digits & other cell has digits in green, it should combine with Red & green digits.