+ Reply to Thread
Results 1 to 7 of 7

Sort while keeping certain rows together where some columns are empty

  1. #1
    Registered User
    Join Date
    07-17-2014
    Location
    Gainesville, Florida
    MS-Off Ver
    MS Office 2013
    Posts
    4

    Sort while keeping certain rows together where some columns are empty

    My spreadsheet has 5 columns: NAME, DATE, ITEM, COST, TOTAL, where TOTAL is given only on last row for a particular NAME & DATE. Names can also be reused with different dates.
    Jane 6/11 box $5
    Jane 6/11 car $15 $20
    Sam 7/2 box $2
    Sam 7/2 kite $5 $7
    Brad 8/1 kite $5
    Brad 8/1 car $10 $15

    If I sort by TOTAL I get:
    Jane 6/11 car $15 $20
    Brad 8/1 car $15 $15
    Sam 7/2 kite $5 $7
    Jane 6/11 box $5
    Brad 8/1 kite $5
    Sam 7/2 box $2

    What I want is:
    Jane 6/11 box $5
    Jane 6/11 car $15 $20
    Brad 8/1 kite $5
    Brad 8/1 car $10 $15
    Sam 7/2 box $2
    Sam 7/2 kite $5 $7

    This is simplistic here, but I have thousands of rows and additional columns (again some with info, others without for each row). I don't do VBA or similar. I've thought I've adding a new column before the name and assigning a number/alpha code, but nothing I've tried has produced my desired result when I sort (using multi-levels).

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Sort while keeping certain rows together where some columns are empty

    Hi, and welcome to the forum.

    Stating the obvious I suppose but have you tried selecting all 5 columns of data then sorting on column A and then a secondary sort on column 5?
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    07-17-2014
    Location
    Gainesville, Florida
    MS-Off Ver
    MS Office 2013
    Posts
    4

    Re: Sort while keeping certain rows together where some columns are empty

    Yes, I've tried that. That's when I get all the lines with a "total" grouped at top and those without at the bottom. I want all of Jane together and all Brad together and so on PLUS Jane before Brad because her "total" is higher.

    I'm attaching a more detailed and actual sample, which might help.

    I inherited this spreadsheet and with thousands of entries so while I would have designed it differently, I'm trying to work with what I have. Also, others have to access it and are even less excel-literate than me.

    Example1.xlsx

  4. #4
    Valued Forum Contributor
    Join Date
    07-07-2014
    Location
    Washington DC
    MS-Off Ver
    2007
    Posts
    1,047

    Re: Sort while keeping certain rows together where some columns are empty

    I'm not sure how easy it will be to accomplish this without changing the way the data is organized in the workbook. Do you have any control over that?

  5. #5
    Registered User
    Join Date
    07-17-2014
    Location
    Gainesville, Florida
    MS-Off Ver
    MS Office 2013
    Posts
    4

    Re: Sort while keeping certain rows together where some columns are empty

    I can make any changes I want - but I do have to be sensitive to someone coming in if I leave or my supervisor who probably does not/will not have the same level of excel knowledge that I have. For example, I use formulas and links to other workbooks that others can't manage.

    My preference would be to spend time now (even if significant) to save time later. This is a spreadsheet I will be dealing with daily - both adding new info and manipulating what is there. So if you have any suggestions I'm definitely interested.

  6. #6
    Valued Forum Contributor
    Join Date
    07-07-2014
    Location
    Washington DC
    MS-Off Ver
    2007
    Posts
    1,047

    Re: Sort while keeping certain rows together where some columns are empty

    It might be easier just to create pivot tables. Look at what I've attached, which is sorted by highest amount billed. Let me know if you think this will work.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    07-17-2014
    Location
    Gainesville, Florida
    MS-Off Ver
    MS Office 2013
    Posts
    4

    Re: Sort while keeping certain rows together where some columns are empty

    Your pivot table example is what I want. I had considered a pivot table briefly, but unfortunately, while it works for me it's way too hard for anyone else here - generally they have only a rudimentary knowledge of excel. They can add items and do a simple sort and maybe a simple SUM function, but anything else is too much. I may just have to go with whatever is best for me and hope I retire before others complain too much.

    Thanks.

+ 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. Delete Empty Rows and empty columns from the word table
    By mvneema in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-25-2014, 10:51 AM
  2. [SOLVED] Remove Empty Rows ,Columns & Sort
    By johncena in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-18-2013, 03:40 AM
  3. Sort while keeping specific rows at the bottom
    By lly in forum Excel General
    Replies: 1
    Last Post: 08-17-2012, 05:37 PM
  4. How to sort worksheet data keeping rows in tact
    By lea147 in forum Excel General
    Replies: 3
    Last Post: 05-10-2008, 05:43 PM
  5. keeping rows intact during sort
    By Jim in forum Excel General
    Replies: 2
    Last Post: 11-24-2005, 10:10 PM

Tags for this Thread

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