Challenged Alphanumeric Sorting

gadie

New Member
Joined
Apr 25, 2013
Messages
2
Hi all,

I'm new to this forum. Generally i'm learning by reading others problems but, this time i couldn't find the answer.
The thing is i'm trying to sort an alphanumeric column with different length size of letters and numbers.
Here an example:
a1
a10
a12
a2
bb1
bb10
bb2
bb4

The column should be sorted as:
a1
a2
a10
a12
bb1
bb2
bb4
bb10

I rather it to be without VBA unless, there is no other choice.

Thanks
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Hi

Welcome to the forum.

Try :-
Code:
=LEFT(A1,FIND(LOOKUP(9.99999999999999E+307, MID(A1,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1&"0123456789")),ROW(INDIRECT("1:"&LEN(A1))))+0),A1)-1)&TEXT(LOOKUP(9.99999999999999E+307, MID(A1,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1&"0123456789")),ROW(INDIRECT("1:"&LEN(A1))))+0),"0000")

this in a spare column, assuming your data starts in cell A1 otherwise change accordingly and drag down.

I assume also that the numbers go up to 9999.

Sort on the spare column that you have entered the formula in.

hth
 
Upvote 0
Thank you Mike. It sure works for me.
Now i'll add some automation to implement on any range with Input box.

Thanks again.
 
Upvote 0
Hi

Thanks for the feedback.

Pleased to have help solve your problem.

Good luck with your project.
 
Upvote 0

Forum statistics

Threads
1,215,374
Messages
6,124,573
Members
449,173
Latest member
Kon123

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