Avatar of nav2567
nav2567
Flag for United States of America asked on

Merge two column in an Excel document.

I have an excel document with a big list in two columns.

I'd like to merge data in column B into column A.

For example:

Column A          Column B
John                    Dole
Mary                   Coleman
........

Result:
Column A
JohnDole
MaryColeman
......

How do I do it?

Please advise.
Microsoft Excel

Avatar of undefined
Last Comment
nav2567

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
flot

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
tel2

Pick an unused column, let's say column C.
Assuming your actual data starts in row 2...
Put the formula =A2&B2 in C2
Drag the formula in C2 down to the end of your data.
If the data in column C looks good...
Select from C2 to the bottom of the data in column C, and do a Copy (e.g. Ctrl-C).
Select A2 and Paste Special Values.
The contents of column C should then change, but you can ignore that.
Delete the contents of column C.
Excel amusant

Here is a macro code. click on macro and the job will be done.

please find attached an example.

Join-Columns.xlsb
Sub Joincolumn()
Dim c As Long
Dim lrow
lrow = Cells(Cells.Rows.Count, "A").End(xlUp).Row
For c = 2 To lrow
Cells(c, 1) = Cells(c, 1) & Cells(c, 2)
Next c

'If you want to delete the contents of column B  then Remove "'" from below lines.

'Columns("B:B").Select
'Selection.ClearContents

End Sub

Open in new window

Yamaafg

You can do it as follow by using formula:

1. Enter this formula in Column D: =CONCATENATE(A2," ",B2)
2. Copy the content of D and paste it in "Column A" as value by using paste special.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
tel2

Hi Yamaafg,

'1. Enter this formula in Column D: =CONCATENATE(A2," ",B2)'
The specifications provided by nav2567 do not include a space between the names, i.e.
   Result:
    Column A
    JohnDole
    MaryColeman

So, unless nav2567 made a mistake in those specifications, your solution would not give him what he wants.  He'd have to do this instead:
  =CONCATENATE(A2,B2)

Besides that, your solution is basically an incomplete version of the one I provided, since the "CONCATENATE" function does basically  the same thing as the (more concise) "&" operator.
nav2567

ASKER
Thanks, everyone.