How To Extract Text Before Or After Dash From Cells?

fidelito101

New Member
Joined
Sep 14, 2018
Messages
13
Hello everybody!
I need some help from you, I have a list of (Song - Artist - Album) in A Column and I would like to put the artist in Column B, the song title in column C and the album title in D.

Thanks in advance

ABCD
The Coasters - Charlie Brown - Poison IvyThe CoastersCharlie BrownPoison Ivy
The Impalas - Sorry (I Ran All the Way Home) - Brand New Cadillac: Rock & RollThe ImpalasSorry (I Ran All the Way Home)Brand New Cadillac: Rock & Roll
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Use TextToColumns. On the last screen of the dialog has a WriteToLocation entry, so you don't have to overwrite the original data.

(BTW, do you file it as Howlin' Wolf or Wolf, Howlin" :) )
 
Upvote 0
Use TextToColumns. On the last screen of the dialog has a WriteToLocation entry, so you don't have to overwrite the original data.

(BTW, do you file it as Howlin' Wolf or Wolf, Howlin" :) )

Thank you very much! I had tried with formulas, but does not work
 
Upvote 0
with Power Query
RawRaw.1Raw.2Raw.3
The Coasters - Charlie Brown - Poison IvyThe CoastersCharlie BrownPoison Ivy
The Impalas - Sorry (I Ran All the Way Home) - Brand New Cadillac: Rock & RollThe ImpalasSorry (I Ran All the Way Home)Brand New Cadillac: Rock & Roll

Rich (BB code):
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Split = Table.SplitColumn(Source, "Raw", Splitter.SplitTextByDelimiter("-", QuoteStyle.Csv), {"Raw.1", "Raw.2", "Raw.3"}),
    Trim = Table.TransformColumns(Split,{{"Raw.1", Text.Trim, type text}, {"Raw.2", Text.Trim, type text}, {"Raw.3", Text.Trim, type text}})
in
    Trim
 
Upvote 0
If you want formulas

=TRIM(LEFT(SUBSTITUTE(A1,"-",REPT(" ",255)), 255))

=TRIM(MID(SUBSTITUTE(A1,"-",REPT(" ",255)), 255, 255))

=TRIM(RIGHT(SUBSTITUTE(A1,"-",REPT(" ",255)), 255))
 
Upvote 0
Or, alternately, if you want a formula, put this in cell B1 (where I have assumed your first data value is in cell A1) and copy it across to cell D1, then copy cells B1, C1, D1 down to the bottom of your data...

=TRIM(MID(SUBSTITUTE("-"&$A1,"-",REPT(" ",300)),COLUMNS($B:B)*300,300))
 
Upvote 0
with Power Query
RawRaw.1Raw.2Raw.3
The Coasters - Charlie Brown - Poison IvyThe CoastersCharlie BrownPoison Ivy
The Impalas - Sorry (I Ran All the Way Home) - Brand New Cadillac: Rock & RollThe ImpalasSorry (I Ran All the Way Home)Brand New Cadillac: Rock & Roll

Rich (BB code):
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Split = Table.SplitColumn(Source, "Raw", Splitter.SplitTextByDelimiter("-", QuoteStyle.Csv), {"Raw.1", "Raw.2", "Raw.3"}),
    Trim = Table.TransformColumns(Split,{{"Raw.1", Text.Trim, type text}, {"Raw.2", Text.Trim, type text}, {"Raw.3", Text.Trim, type text}})
in
    Trim

Thank you very much for your help
 
Upvote 0

Forum statistics

Threads
1,215,695
Messages
6,126,261
Members
449,307
Latest member
Andile

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