Sort data in Excel

Hi I want to sort the data. and I got group 1 after I sorted it, but I hope to get it like group 2. Anyone can give me some suggestion ?

Group1:
 GigabitEthernet1/1
 GigabitEthernet1/10
 GigabitEthernet1/11
 GigabitEthernet1/18
 GigabitEthernet1/19
 GigabitEthernet1/2


Group2
 GigabitEthernet1/1
 GigabitEthernet1/2
 GigabitEthernet1/10
 GigabitEthernet1/11
 GigabitEthernet1/18
 GigabitEthernet1/19
eemoonAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

FlysterCommented:
If you just need to sort off of the last numbers, you can use this formula to convert them from text. Change A1 to your reference cell. Sort on this column:

=VALUE(MID(A1,FIND("/",A1)+1,LEN(A1)-FIND("/",A1,1)))

Flyster
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Naresh PatelTraderCommented:
And if you wana sort values before "/" then put this formula in say column B and Mr.Flyster formula in column C, so you can sort both ways.
=SUMPRODUCT(MID(0&(LEFT(A1,(LEN(A1)-((LEN(A1)-FIND("/",A1))+1)))),LARGE(INDEX(ISNUMBER(--MID((LEFT(A1,(LEN(A1)-((LEN(A1)-FIND("/",A1))+1)))),ROW($1:$25),1))* ROW($1:$25),0),ROW($1:$25))+1,1)*10^ROW($1:$25)/10)

Open in new window

Assuming your data in column A.

Thanks
0
CompProbSolvCommented:
Another option is to use leading zeroes.  For example: use GigabitEthernet1/02 instead of GigabitEthernet1/2.
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

eemoonAuthor Commented:
Hi Thanks all for your fast reply. @CompProbSolv, how to add "0" before that digit ?
0
Naresh PatelTraderCommented:
Adding "0" before that digit is simple thing but I guess you wont get solution what you looking for i.e. sorting.

=LEFT(A1,(FIND("/",A1)-1))&("/0"&MID(A1,FIND("/",A1)+1,LEN(A1)-FIND("/",A1,1)))

Open in new window

Thanks
0
CompProbSolvCommented:
I wasn't clear enough.  I should have said: "use leading zeroes when there is a single digit after the slash".

I used itjockey's formula but made it conditional:
=IF(FIND("/",A1)=LEN(A1)-1,LEFT(A1,(FIND("/",A1)-1))&("/0"&MID(A1,FIND("/",A1)+1,LEN(A1)-FIND("/",A1,1))),A1)

Basically, if the second to last character is "/", then use his formula to add the 0.  If not, don't make any changes.

You could then sort both columns based on the new one and you'd have your original data sorted as you wish without the leading zeroes displayed.

This assumes, of course, that there will be no more than 2 digits after the /.  If you need to allow for a third digit the formula could be extended.
0
Naresh PatelTraderCommented:
instead of adding only one "0" try this formula which add zeros according its requirement.
=LEFT(A1,(FIND("/",A1)-1))&"/"&IF(LEN(A1)-FIND("/",A1)=1,"000",IF(LEN(A1)-FIND("/",A1)=2,"00",""))&MID(A1,FIND("/",A1)+1,LEN(A1)-FIND("/",A1,1))

Open in new window

Thanks
0
Naresh PatelTraderCommented:
oops Mr.CompProbSolv,

seen your comment after posting mine as my browser not auto refresh.
0
ProfessorJimJamCommented:
i think Flyster solution is simple and working.   you simply use that and then use the sort a-z from the Data tab.
0
tilsantCommented:
Assuming the data is in Column A.

Another possible solution without using formulas is to:
1. Copy the column contents to an adjacent column - Column B
2. Do Text-to-Column on Column B with delimiter as "/"
3. Sort using Column B and Column C

This solution is independent of number of digits after "/".
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.