Splitting a cell based on dashes

randrze2

New Member
Joined
Jul 8, 2014
Messages
11
Hello,

I have the following situation. I have a column of cells that have the first part of the cell (ID number) separated by a dash but occasionally within the latter part of the cell there exist other dashes in the description. I was wondering how to get the description part that is just after the first dash. I've tried TRIM and some other functions to no avail. Example below. Thanks for you help!

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Original[/TD]
[TD]Desired Output[/TD]
[/TR]
[TR]
[TD]123 - Apple-Cider Juice[/TD]
[TD]Apple-Cider Juice[/TD]
[/TR]
[TR]
[TD]2244 - Yellow-Cheese - 12oz[/TD]
[TD]Yellow-Cheese - 12oz[/TD]
[/TR]
[TR]
[TD]55A - Regular Coffee[/TD]
[TD]Regular Coffee[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Assuming there is ALWAYS a space after the first hyphen,

Try
=MID(A2,FIND("-",A2)+2,LEN(A2))
 
Upvote 0
This will work whether the first dash is surrounded by spaces or not...

=TRIM(MID(A1,FIND("-",A1&"-")+1,99))
 
Upvote 0

Forum statistics

Threads
1,223,099
Messages
6,170,107
Members
452,302
Latest member
TaMere

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