Sorting data question

Copper Contributor

Hello there,

 

quick question: I want to sort an inventory sheet by a column that contains the item designator with characters and numbers like "MT_A_67" and "MT_A_8", etc. My problem is that during sorting "MT_A_67" lists before "MT_A_8" so it doesn't compare the number 8 and 67 correctly. What is the solution?

Thank you!

5 Replies

@33tixe

Insert three empty columns to the right of the column with the item designators.

Select the item designators.

On the Data tab of the ribbon, click Text to Columns.

Select Delimited, then click Next >.

Tick the check box for Other and enter an underscore _ in the box next to it.

Click Finish.

You now have three extra columns. You can sort the range on the number column, or any combination of columns that you want.

@33tixe 

To achieve what you are trying, you need a Helper Column.

 

Rajesh-S_0-1618734422244.png

  • Enter this in cell Y 20 & fill down:

 

=MID(X20,FIND("#",SUBSTITUTE(X20,"_","#",2))+1,255)

 

  • Select entire data range X19:Y23.
  • From Home Tab hit the SORT icon.
  • Select Custom Sort.

Rajesh-S_6-1618734952987.png

 

  • Now hit Ok.
  • You find this dialogue.

Rajesh-S_2-1618734690274.png

  • Select the first option & finish with Ok.
  • You find data in desire order.

Rajesh-S_3-1618734774091.png

For neatness later on you may hide Helper Data & you find this.

 

Rajesh-S_5-1618734848323.png

 

 

 

 

 

  

thanks so much
thank you so much
Glad to help you,,, since my method is working for you,, then you may accept it as best answer as well like ☺