Un-Merging Cells

chad13

Board Regular
Joined
Oct 14, 2002
Messages
105
I have cells that have multiple line items in the cell and need to separate those line items into separate cells.

For Example:

Cell B2 contains:
ABC
123
456
DEF

I need those separate line items in B2 broken out into:

C2 - ABC
C3 - 123
C4 - 456
C5 - DEF

I hope this wasn't confusing.

Thanks,

Chad
 

Some videos you may like

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

QuietRiot

Well-known Member
Joined
May 18, 2007
Messages
1,077
what does that cell actually look like. how can i replicate this:

ABC
123
456
DEF

into 1 cell. Im trying to reproduce it on my end but cant.
 

chad13

Board Regular
Joined
Oct 14, 2002
Messages
105
Goto B2 and enter the following:

ABC<alt><enter>123<alt><enter>456<alt><enter>DEF<enter>

I believe it is a merge function.
 

chad13

Board Regular
Joined
Oct 14, 2002
Messages
105
Ok, that last post did not post right.

In B2 enter:

ABC (then hit alt-enter) 123 (alt-enter) 456 (alt-enter) DEF (alt-enter)
 

shades

Well-known Member
Joined
Mar 20, 2002
Messages
1,550

ADVERTISEMENT

Typically, the line break within a cell is CHAR(10) or CHAR(13). You could segment out by formula each portion based on what it is and which one is referenced.
 

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
With a macro but this is very specific:

Code:
Sub unmurge()
Dim x, myarray, i As Integer
x = Range("B2").Value
myarray = Split(x, Chr(10))
If IsArray(myarray) Then
    For i = LBound(myarray) To UBound(myarray)
        Cells(2, i + 2).Value = myarray(i)
    Next i
End If
End Sub
 

shades

Well-known Member
Joined
Mar 20, 2002
Messages
1,550
For the first three letters in C2,

=LEFT(B2,3)

For the last three letters in C5,

=RIGHT(B2,3)

The other two would have to involve stripping away what is in C2 and C5 and applying the formulas, accounting for the CHAR(10), which is the equivalent of ALT + ENTER

So, in C3 use MID

=MID(B2,5,3)

in C4, use

=MID(B2,9,3)
Obviously, this assumes that there will always be three letters/numbers in each set. If not, then the formula gets more complicated.
 

Watch MrExcel Video

Forum statistics

Threads
1,123,087
Messages
5,599,654
Members
414,325
Latest member
kfg1287

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top