+ Reply to Thread
Results 1 to 4 of 4

Sort a group of names based on the group total

  1. #1
    Valued Forum Contributor ron2k_1's Avatar
    Join Date
    09-30-2009
    Location
    Not the USA
    MS-Off Ver
    Excel 2003, 2007
    Posts
    606

    Sort a group of names based on the group total

    Hi

    I've searched a bit but didn't turn anything that helps in my case, so a hand is once needed. I have the attached worksheet and I want to sort the data on the "Data" tab by the total of each group, so that I have a listing similar to that of "Data (2)".

    Help will be immensely appreciated.

    Thanks
    Attached Files Attached Files
    Last edited by ron2k_1; 08-13-2010 at 04:36 PM.
    Ron
    Knowledge is knowing that a tomato and pepper are fruits. Wisdom is knowing whether to put these in a fruit salad

    Kindly

    [1] Use code tags. Place "[code]" before the first line of code and "[/code"]" after the last line of code. Exclude quotation marks
    [2] Mark your post [SOLVED] if it has been answered satisfactorily by editing your original post in advanced mode.
    [3] Thank (using the little scale) those that provided useful help; its nice and its very well appreciated

  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 a group of names based on the group total

    Hi

    I've taken the liberty of slightly changing your data. See the Data (3) tab on the attached. Using this layout allows you to use the Pivot Table functionality which simplifies things immeasurably.

    Note I've removed the subtotals and added an extra helper columns which sums the values for each client name. We can then use this helper column in the pivot table - see column G. You'll probably want to hide this since it's just used by the pivot table to arrange the totals in descending order.

    The pivot table could be be in a pivot table sheet of its own if you prefer. Just right click anywhere in the PT, choose PT wizard and select New WorkSheet.

    HTH
    Attached Files Attached Files
    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
    Valued Forum Contributor ron2k_1's Avatar
    Join Date
    09-30-2009
    Location
    Not the USA
    MS-Off Ver
    Excel 2003, 2007
    Posts
    606

    Re: Sort a group of names based on the group total

    Thank you,

    I knew this was around the Pivot Table's alley, but, as lots of people, this a weakness to me. Would you mind to walk me through the steps u took in generating the pivot table from your modified data table. I know what to do up to point when you need to start dropping fields into the pivot table (where to do it and whether it is a row or column, etc.

    Thanks

  4. #4
    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 a group of names based on the group total

    Hi,

    1. Select the data in A2:E25 and from the menu pick Data Pivot Table, then Next, Next, select a location in the existing worksheet and Finish

    2. Right click in the table, select Pivot Table Wizard and layout

    3. Drag the sorted total field, then the Group Name field, then the Client Name field, then the Account No field into the row fields section, and drag the Amount filed into the Data items area.

    4. For those fields where you don't want a subtotal, right click the field name, pick field settings and tick the None for subtotals and OK.

    5. Finally right click the sorted total field, click field settings then Advanced and in the Auto sort options pick the Descending option and OK

    Regards

+ 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