Forum Discussion

Christine_S_'s avatar
Christine_S_
Copper Contributor
Dec 01, 2021
Solved

How do I sort by number in cells containing text?

Hi How can I sort a column of cells that contain the format number text numerically? I have read that I need to change the filter to numerical rather than A–Z, but I can't work out how to do that.  ...
  • ExcelExciting's avatar
    Dec 01, 2021

    Hi Christine_S_ ,

     

    I have seen the screenshot of you dataset and the value that are stored though they look numbers but stores are text, when you sort the data it read 1 and look next sort sequence 11 and so on. Solution to this problem you need add one leading  zero to your dataset for the single digit or two zeros depending on you length of number. Using the below formula in the helper column for single digit.

     

     

    =SUBSTITUTE(A2,LEFT(A2,FIND(" ",A2,1)-1),TEXT(LEFT(A2,FIND(" ",A2,1)-1),"00"))

     

     

     

    Attaching the sample file for your ready reference.

     

    Regards, Faraz Shaikh | Microsoft MVP, MCT, MIE, MOS Master, Excel Expert

    If you find the above solution resolved your query don't forget mark as Official/Best Answer & like it to help the other members find it more.

Resources