+ Reply to Thread
Results 1 to 18 of 18

Numbers don't sort properly

  1. #1
    Forum Contributor
    Join Date
    03-06-2015
    Location
    houston, tx
    MS-Off Ver
    MS 365
    Posts
    494

    Numbers don't sort properly

    My sample file is attached. Need to sort from smallest to largest. Thank you
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,444

    Re: Numbers don't sort properly

    Which column are you wanting to sort?

    Many of the numbers in column A are just text (that's why they have a green triangle top left) - is this the column causing you problems?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,863

    Re: Numbers don't sort properly

    I'm not certain exactly what you are looking for, but, an ISTEXT(A3) [copied down and across] function shows that some of the values in column A are numbers stored as text. I would guess that is the cause for Excel sorting incorrectly, and I expect the solution is to convert all the numbers stored as text to real numbers. Strategies for converting numbers stored as text to numbers here: https://support.microsoft.com/en-us/...1-c5bad0f0a885
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  4. #4
    Forum Contributor
    Join Date
    03-06-2015
    Location
    houston, tx
    MS-Off Ver
    MS 365
    Posts
    494

    Re: Numbers don't sort properly

    Column B is the one I need to sort from smallest to largest.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,444

    Re: Numbers don't sort properly

    Select A3 to B9.

    Data ribbon | Sort ...

    Select Column B from the drop-down.

    AliGW on MS365 Insider (Windows) 32 bit
    A
    B
    3
    65486546
    2
    4
    65486546
    2
    5
    20210502545
    4
    6
    20210502233
    4
    7
    20210502238
    4
    8
    20210502347
    4
    9
    20210502423
    4
    10
    20210502520
    4
    11
    20210502586
    4
    12
    20210502220
    8
    13
    20210502242
    8
    14
    20210502243
    8
    15
    20210502287
    8
    16
    20210502298
    8
    17
    20210502318
    8
    18
    20210502321
    8
    19
    20210502326
    8
    20
    65486546
    8
    21
    20210700538
    14
    22
    20210700557
    14
    23
    20210502351
    15
    24
    20210502522
    15
    25
    20210502402
    18
    26
    20210502221
    20
    27
    20210502245
    20
    28
    20210502361
    20
    29
    20210502398
    20
    Sheet: Sheet1

  6. #6
    Forum Contributor
    Join Date
    03-06-2015
    Location
    houston, tx
    MS-Off Ver
    MS 365
    Posts
    494

    Re: Numbers don't sort properly

    Yes. Thank you. The sample file does sort?

    However, my Master File still does not sort. I will send a sample of that file itself and not a copied sample file.
    Attached Files Attached Files

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,444

    Re: Numbers don't sort properly

    I can't see a problem. Works fine. Did you select the entire dataset before sorting?
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    03-06-2015
    Location
    houston, tx
    MS-Off Ver
    MS 365
    Posts
    494

    Re: Numbers don't sort properly

    Yes selected the entire database. Must be some issue on my system? I checked Unmerge; UnFreeze; and formatted as Number. Any ideas what I may be missing?

  9. #9
    Forum Contributor
    Join Date
    03-06-2015
    Location
    houston, tx
    MS-Off Ver
    MS 365
    Posts
    494

    Re: Numbers don't sort properly

    Found the problem. Some of the cels in Column A were blank. And when I highlighted the cells, I did the short cut method and did not pick up all the cells below the ones with a blank cell in A. Live and Learn. Your comments about "Did you select the entire database", made me relook. Thanks, blessings,

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,444

    Re: Numbers don't sort properly

    Thanks for the rep.

  11. #11
    Forum Contributor
    Join Date
    03-06-2015
    Location
    houston, tx
    MS-Off Ver
    MS 365
    Posts
    494

    Re: Numbers don't sort properly

    Your welcome. Just opened another large file to convert. This time I did highlighted all cells. And the B column will not sort. It seems to think it is TEXT, even though I formatted it as Number. Ideas?

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,444

    Re: Numbers don't sort properly

    It's probably text. Do you see a green triangle?

    Formatting as a number - did this add .00 to the numbers? If not, then they are not numbers. Formatting doesn't actually convert.

  13. #13
    Forum Contributor
    Join Date
    03-06-2015
    Location
    houston, tx
    MS-Off Ver
    MS 365
    Posts
    494

    Re: Numbers don't sort properly

    No, don't see a green triangle. But I think they are text as they do not sort

  14. #14
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,444

    Re: Numbers don't sort properly

    I can't say for sure. Are they right or left-aligned?

  15. #15
    Forum Contributor
    Join Date
    03-06-2015
    Location
    houston, tx
    MS-Off Ver
    MS 365
    Posts
    494

    Re: Numbers don't sort properly

    The numbers came about using the formula Vlookup. To match a crime description to a set of number codes. I then formatted the results as numbers. So, it could be in the way the formula saved them?

  16. #16
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,444

    Re: Numbers don't sort properly

    What's the formula? You forget that I am working blind here!

    Again - formatting as a number does not make anything into a number!

  17. #17
    Forum Contributor
    Join Date
    03-06-2015
    Location
    houston, tx
    MS-Off Ver
    MS 365
    Posts
    494

    Re: Numbers don't sort properly

    That was the issue. When I used the Vlookup, I did not format the cells for numbers properly. They were formatted as General. That carried over and did not format as a number. I redid, and formatted the Vlookup column for the code number , as a number. And when I ran the formula and the code number appeared on my large data file column, they sorted.

  18. #18
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,444

    Re: Numbers don't sort properly

    Great.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Can't sort Column properly
    By Stormy1234 in forum Excel General
    Replies: 1
    Last Post: 08-03-2021, 12:49 PM
  2. [SOLVED] Can't sort numbers properly
    By ARP711 in forum Excel General
    Replies: 3
    Last Post: 04-23-2021, 01:50 PM
  3. [SOLVED] Columns don't sort properly in VBA
    By Frankie_The_Flyer in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-10-2019, 01:31 AM
  4. Sort not working properly
    By bradleyandrewdavis in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-02-2015, 02:01 PM
  5. Won't permanently sort properly
    By GigaFluxx in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-14-2015, 11:32 AM
  6. [SOLVED] Sort function not working properly...
    By dllivermore in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-01-2012, 05:45 PM
  7. My numbers do not sort properly
    By MiriBella in forum Excel General
    Replies: 7
    Last Post: 06-20-2012, 06:31 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1