Splitting concat into one column

Mooncake1

New Member
Joined
Sep 18, 2021
Messages
16
Office Version
  1. 365
Platform
  1. Windows
Hi everyone! I have a single cell with contains a concatenated bunch of values.

It looks like this
Excel Formula:
Orange-Blue-Green-Pink-Yellow-Green3-Cyan-Majenta-Brown-White-Aqua-Black
The concatenate is variable and changes a lot in size so it cant really be hardcoded
Im trying to make it trim these words out using "-" delimiter.

End goal is to make this split into one column range where it spills down one row for each word delimited.

EG:
Book1
ABCDEFGH
1Orange-Blue-Green-Pink-Yellow-Green3-Cyan-Majenta-Brown-White-Aqua-Black
2
3Result:Orange
4Blue
5Green
6Pink
7Yellow
8Green3
9Cyan
10Majenta
11Brown
12White
13Aqua
14Black
Sheet1
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Hey Mooncake1 ! Welcome to Board.

You can use text to column option .

1631944271713.png


After select your data

1631944336667.png


1631944380293.png


You data look like this .

1631944434637.png


Then you can use Transpose function Like below pic
Book1.xlsm
BCDEFGHIJKLMNO
2OrangeBlueGreenPinkYellowGreen3CyanMajentaBrownWhiteAquaBlack
3Orange
4Blue
5Green
6Pink
7Yellow
8Green3
9Cyan
10Majenta
11Brown
12White
13Aqua
14Black
15#N/A
16#N/A
17#N/A
18#N/A
19#N/A
20
21
22
Sheet5
Cell Formulas
RangeFormula
O3:O19O3=TRANSPOSE(B2:M2)
Press CTRL+SHIFT+ENTER to enter array formulas.


Hope it will resolve your porblem!
 
Upvote 0
Code:
Sub Maybe()
Dim a
a = Split([A1], "-")
    Range("B1").Resize(UBound(a) + 1).Value = Application.Transpose(a)
End Sub

If you want it shorter.
Code:
Sub Maybe()
    Range("B1").Resize(UBound(Split([A1], "-")) + 1).Value = Application.Transpose(Split([A1], "-"))
End Sub
 
Upvote 0
With Power Query

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(Source, {{"Column1", Splitter.SplitTextByDelimiter("-", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Column1")
in
    #"Split Column by Delimiter"
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,191
Members
452,616
Latest member
intern444

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
Back
Top