Sort numerically with - A-Z after them.

Copper Contributor

I am trying to sort a large tool room list numerically so it can be reorganized.  The problem I am running into is have the sheet has numbers only for the tools and the other half the sheet has letters or numbers after the number with a dash (51701-blt).  I have seven columns in this spreadsheet:

quantity, tool number, description, section,kit, sort order, notes, and location.

 

I appreciate anyone's help in this.  I want to sort by sort order.

5 Replies

Hello,

 

I assume that the problem is that number will be sorted after text, like in this screenshot, is that correct?

 

2019-01-17_13-24-04.png

 

When cells contain a mix of text and numbers, text will be sorted after the numbers. If you want to sort strictly by the numerical value, you need to pull the number into a helper column. The formula to do that is showing in cell E12

 

=LEFT(D12,FIND("-",D12&"-")-1)+0

 

Now you can sort the table by the helper column.

More like this.

Screen Shot 2019-01-16 at 10.13.23 PM.png

Would you like me to keep guessing what you want to achieve and what the problems are, or are you prepared to speed things up a bit and use your own words?

 

So, you have text that starts with numeric characters and has leading zeros. Fine. 

 

Now what? With real numbers ranging from ?? to ??, where would you like to see your text cells in the sort order? Please give me something to aim for.

 

Mock it up and post the expected result, then things will be so much easier to work out.

Here is what I am working with.  The current is the top section and the expected is the bottom.  I have roughly 4k tools to sort.

Screen Shot 2019-01-17 at 6.19.38 AM.png

That helps, thanks.

 

This now shows me that there is no pattern that we can use in a Left or Mid function by just looking at the dash. Instead, the approach needs to be to use a helper column that extracts all numeric characters from the cell.

 

Here is the formula that does that to the number in F5 (change accordingly)

 

=SUMPRODUCT(MID(0&F5,LARGE(INDEX(ISNUMBER(--MID(F5,ROW($1:$25),1))*
ROW($1:$25),0),ROW($1:$25))+1,1)*10^ROW($1:$25)/10)

 

And here is a screenshot to see this in action.

 

extract numbers from text.png

 

Does that get you any further?