tags:

views:

1072

answers:

4

Hi I'm not even sure if this is actually possible in excel, but I am trying to merge two rows together, for example I have data that looks a little like this (each like would be a separate row):

1001001
0100101

1010101
1010101

and I would like to merge the two rows like:

1001001-0100101

1010101-1010101

Does anyone have any suggestions? Thank you so much

+6  A: 

String concatenation in excel uses &

 =(A1 & "-" & A2)
StuperUser
A: 

Copy the entire data and paste it in duplicate to the right of the original data.

1001001 1001001

0100101 0100101

1010101 1010101

1010101 1010101

Delete a few cells at the top of the new columns -- one row's worth. You have now gotten each record consolidated on one row. You also have a junk record for every other row.

1001001 0100101

0100101 1010101 (junk row)

1010101 1010101

1010101 (junk row)

Find a way to delete the junk records. I might start by adding a column that is consecutive numbers ("Fill Series"), to restore the sort order later. Then find a way to sort for odd-numbers then even-numbers, such as a column with formula IF(divisible by 2,"odd","even"). Then delete half the records.

Smandoli
+1  A: 

To the immediate right of the end of your last column, at the first row, type the following:

=A1 & "-" & B1

Go one column over to the right and type this:

=A2 & "-" & B2

Now highlight both of those new cells that you just typed, and grab the little autofill box in the lower right corner of your selected cells, and drag over until your new area is the same width as the original row.

Now, highlight the entire new section you've just created, and drag it down to the bottom of your data area.

Highlight the whole block of new data, hit Ctrl-C, and then right click somwhere and choose "Paste Special". In the dialog that appears, choose "Values", and hit "OK". Now you can move this new block anywhere you want without regard to other cells.

Finally, you will need to delete every other row of your newly pasted data, beginning with the second row.

JosephStyons
A: 

Excel has a CONCATENATE function to join multiple cell values and adhoc text. Up to 255 values can be joined this way

=CONCATENATE(A1,"-",A2)

This would return the following based on your data:

1001001-0100101
1010101-1010101
Robert Mearns