Cutting off part of a word in one cell

kmkpsu22

New Member
Joined
Jun 23, 2005
Messages
23
Problem: I want to sort part #'s by type, but the # comes first so if I sort it will go by the parts number.

ex: Srg000241-A500
Srg000356-B3779

where A500=machine 1 and B3779=machine 2


I have a bunch of those parts and they all end in -_____. I want to sort by what comes after the dash. My idea was to search the cell for the dash, copy everything that comes after the dash and then paste it into a row of empty cells and then sort by this new row.

Can anyone help with this code?

Thanks!
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Hi Kevin,

Assuming the original data is in A1 then add this to B1:

=MID(A1,FIND("-",A1)+1,999)

HTH
 
Upvote 0
Try Data>Text to Columns... with - as a delimiter.
 
Upvote 0
Ritchie,

I was looking at your formula and I don't quite follow how it functions...

=MID(A10,FIND("-",A10)+1,999)

I follow the formula up to the +1, but I don't understand the 999 part.

If you have time to post an explanation, I would really appreciate it. This is an interesting formula to me...

Thanks
Wally

*************

Ok, I get it....you used 999 as a really high number of characters to look up.
 
Upvote 0

Forum statistics

Threads
1,214,899
Messages
6,122,155
Members
449,068
Latest member
shiz11713

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