Super Advanced Search Algorithm Annoyance

IREALLYambatman

Board Regular
Joined
Aug 31, 2016
Messages
63
Sooo.. I have a ton of data and I need it arranged all by one Row... And using Regex, and custom order, and ascending.. I'm 90% of the way there, unfortunately I'm now kinda stuck, I need to sort like this :

AAAAAA x2 AAA x5AAA x10

<tbody>
</tbody>

And Excel does this:

AAAAAA x10AAA x2AAA x5

<tbody>
</tbody>

So Excel Looks at each charecter and says that x10 should come before X2 because you well, it fails to understand that 10 < 2.

What can I do to fix this? I have all the rest done, all the AAA's and BBB's are in order, it's just the x2 or x5 or x20 or xwhatever that it fails to realize that is a number.. help?
 
Last edited:

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Classing sorting "numbers as text" issue
- easily solved if you make numbers consistent
- insert leading zeros
- with your example increase all numbers to 2 digits
- if largest number is 3 digits then make EVERY number 3 digits


So instead of
AAA AAA x2
AAA x5
AAA x10

<tbody>
</tbody>

Amend data like this and the problem goes away
AAA AAA x02
AAA x05
AAA x10

<tbody>
</tbody>
 
Last edited:
Upvote 0
Classing sorting "numbers as text" issue
- easily solved if you make numbers consistent
- insert leading zeros
- with your example increase all numbers to 2 digits
- if largest number is 3 digits then make EVERY number 3 digits


So instead of
AAA AAA x2 AAA x5 AAA x10

<tbody>
</tbody>

Amend data like this and the problem goes away
AAA AAA x02 AAA x05 AAA x10

<tbody>
</tbody>
thanks dude, you rock!
 
Upvote 0

Forum statistics

Threads
1,214,574
Messages
6,120,327
Members
448,956
Latest member
Adamsxl

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