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!

OriginalDesired Output
123 - Apple-Cider JuiceApple-Cider Juice
2244 - Yellow-Cheese - 12ozYellow-Cheese - 12oz
55A - Regular CoffeeRegular Coffee

<tbody>
</tbody>
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
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,215,970
Messages
6,127,987
Members
449,414
Latest member
sameri

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