+ Reply to Thread
Results 1 to 6 of 6

Group By and Sort

  1. #1
    Registered User
    Join Date
    08-23-2013
    Location
    florida
    MS-Off Ver
    excel 2007
    Posts
    6

    Group By and Sort

    Hi all,

    Hope somebody can help me. I have a excel sheet where column A list a bunch of names (sometimes the same name is listed multiple times) and column B that has a dollar amount. On the rows that have the same name listed the first one will contain a dollar amount and the subsequent rows for the same name will be 0.00 or blank. I need to sort the sheet high to low dollar but with the names staying together.
    Can somebody assist in helping me accomplish this?
    I'm using Excel 2010

    Thanks

  2. #2
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Group By and Sort

    Hi
    Excel can add layers to your sort, so sort by column A (names) then by column B (values) should do the trick, unless you don't want the names alphabetically sorted

    on the data tab select tools > sort and click add level to add col B

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: Group By and Sort

    Nicky, that wont sort by High to low, and keep the names together
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Group By and Sort

    it should do - unless the names are not identical or you don't want them in alphabetical order
    you don't do two separate sorts, it is one sort on names first then values, like this:
    Capture.PNG
    if this doesn't work, can you give a bit more detail on what your sort returns and how it differs from what you want?

  5. #5
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Group By and Sort

    ah - sorry, re-read the question and you're right!

  6. #6
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Group By and Sort

    ok, try this (assuming names are in Col A, Col B has values and Col C is blank, cells A1:B20 have names and values)

    1) sort A1:B20 by column B, highest to lowest
    2) in cell C1 place this formula and copy down to all cells in C1:C20
    =MATCH(A1,A$1:B$20,0)
    3) select range C1:C20, copy, paste special, paste values to convert the formulas to values
    4) select the range A1:C20 and sort on column A ascending, Column B Descending
    Last edited by NickyC; 02-20-2014 at 12:28 AM. Reason: add $ to formula

+ 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. Replies: 1
    Last Post: 10-19-2012, 07:55 AM
  2. Sort and group
    By kmlprtsngh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-05-2010, 08:27 AM
  3. Sort a group of names based on the group total
    By ron2k_1 in forum Excel General
    Replies: 3
    Last Post: 08-13-2010, 01:16 PM
  4. sort and group
    By tango in forum Excel General
    Replies: 1
    Last Post: 05-30-2009, 10:57 PM
  5. Sort by group
    By DexterV in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 07-08-2005, 08:48 AM

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