+ Reply to Thread
Results 1 to 5 of 5

Sorting empty cells

  1. #1
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Sorting empty cells

    I'm using Excel 2007.
    I have a column that contains either "True" or is empty. I would like to sort it so that the empty cells are at the top.

    I can't find any way to do it.
    Foxguy

    Remember to mark your questions [Solved] and rate the answer(s)
    Forum Rules are Here

  2. #2
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Sorting empty cells

    Nor can I.
    But I can use a trick: fill the empty cells with a space, sort and delete those added spaces.



  3. #3
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,375

    Re: Sorting empty cells

    use a helper column that evaluates the cells and sort by the helper column

    =if(a1,1,0)

  4. #4
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,375

    Re: Sorting empty cells

    Some explanation:

    Booleans are not treated as text. They are rated larger than numbers, larger than text, and smaller than empty cells. True is larger than False

    So, sort order is

    1
    2
    3
    a
    b
    c
    FALSE
    TRUE
    <empty cell>

    Try it.

  5. #5
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: Sorting empty cells

    teylyn;

    Your order in the previous post seems to indicate that an empty cell would be sorted as greater than a boolean, so if I sorted in xlDescending order all the empty cells would be at the top. It didn't work.

    But I like your idea of using a helper column better any way. Let's me decide whatever order I would like. I could create my own order if I want - 1,a,2,b,3,c etc.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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