Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting Problem 1

Status
Not open for further replies.

TopDawg

MIS
Mar 13, 2001
54
US
I am tying to sort the following in excell.

aaaaaaaa-01-100
aaaaaaaa-20-101
ffdfafsf-17-103

I am trying to sort only by the 01,20,17. Disregarding the other letters and numbers.

Thanks in advance for any assistance.
 
Hi TopDawg,

If you have columns to spare try breaking the string apart to get the element you want to sort on in a column by itself and sorting on that column.

If all your records are in the format (some string)-nn-(some other string) where nn is always 2 characters then =MID(A1,FIND("-",A1)+1,2) in column B will do it.

If the length of the string in the middle is variable it is a little more complicated but =MID(A1,FIND("-",A1)+1,FIND("-",A1,FIND("-",A1)+1)-FIND("-",A1)-1) should do it - but I would do it step by step over more than one column if you have them.

Hopefully you get the general picture and can change to suit if need be. If not, please come back with more detail.

Enjoy,
Tony
 
THANK YOU !!!

It worked great. Just the results I needed.
 
TopDawg - looks like Tony helped you out there. The way to say thanks in TekTips is to award a star. This also helps those people who search the archives to narrow down their searches to those threads with stars - which would indicate helpful information / resolution of the question. To award a star, simply click on the "Mark this post as a helpful / expert post" link at the bottom of the appropriate thread

Rgds
Geoff
Si hoc legere scis, nimis eruditionis habes
Get the best answers to your questions - faq222-2244
 
Hi TopDawg,

The real satisfaction is just in helping - and learning, but thanks for the star - it does help highlight threads for people searching and there is a lot here to find.

Enjoy,
Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top