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 :

[TABLE="width: 500"]
<tbody>[TR]
[TD]AAA[/TD]
[TD]AAA x2[/TD]
[TD] AAA x5[/TD]
[TD]AAA x10[/TD]
[/TR]
</tbody>[/TABLE]

And Excel does this:

[TABLE="width: 500"]
<tbody>[TR]
[TD]AAA[/TD]
[TD]AAA x10[/TD]
[TD]AAA x2[/TD]
[TD]AAA x5[/TD]
[/TR]
</tbody>[/TABLE]

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

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
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
[TABLE="class: cms_table"]
<tbody>[TR]
[TD]AAA [/TD]
[TD] AAA x2
[/TD]
[TD] AAA x5
[/TD]
[TD] AAA x10
[/TD]
[/TR]
</tbody>[/TABLE]

Amend data like this and the problem goes away
[TABLE="class: cms_table"]
<tbody>[TR]
[TD]AAA[/TD]
[TD] AAA x02
[/TD]
[TD] AAA x05
[/TD]
[TD] AAA x10
[/TD]
[/TR]
</tbody>[/TABLE]
 
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
[TABLE="class: cms_table"]
<tbody>[TR]
[TD]AAA[/TD]
[TD] AAA x2[/TD]
[TD] AAA x5[/TD]
[TD] AAA x10[/TD]
[/TR]
</tbody>[/TABLE]

Amend data like this and the problem goes away
[TABLE="class: cms_table"]
<tbody>[TR]
[TD]AAA[/TD]
[TD] AAA x02 [/TD]
[TD] AAA x05[/TD]
[TD] AAA x10[/TD]
[/TR]
</tbody>[/TABLE]
thanks dude, you rock!
 
Upvote 0

Forum statistics

Threads
1,223,897
Messages
6,175,270
Members
452,628
Latest member
dd2

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