+ Reply to Thread
Results 1 to 11 of 11

Filter a Group by Max Value

  1. #1
    Forum Contributor
    Join Date
    03-30-2014
    Location
    https://t.me/pump_upp
    MS-Off Ver
    Excel 2013
    Posts
    274

    Filter a Group by Max Value

    Hi, hope I can get some help here please.
    I wish to filter a worksheet with Max Val for a group
    Group is in A column
    Values are in I column
    Appreciate any help here please
    Graham
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    11-04-2018
    Location
    Denpasar
    MS-Off Ver
    Excel 2010
    Posts
    777

    Re: Filter a Group by Max Value

    Sorry, this is may not help you as I can't understand what you mean about filtering.

    Anyway the code below will list on column K
    each name in column A with it's maximum value in column i.

    Please Login or Register  to view this content.
    I wish to filter a worksheet with Max Val for a group
    Based on the information of the list in column K, then later on you can filter the data.

    The things which is not clear to me :
    Did you mean that you want the code to just loop the filter process,
    without you even can't have the chance to see the filtered result ?

    OR
    did you mean the code will loop and stop on each filtered result by giving you a message box ?
    Something like this :
    The code filtered the max value of Graf1
    then show a message box - so you can see Graf1 max value...
    after you hit OK in the message box,
    the code filter the max value of Graf2
    then show a message box - so you can see Graf2 max value...
    and so on
    .
    .
    .
    until the last group ...
    the code filter the max value of 8
    then show a message box - so you can see 8 max value...
    after you hit OK in the message box,
    the code stop.

    something like that ?
    Last edited by karmapala; 09-20-2021 at 04:26 AM.

  3. #3
    Forum Contributor
    Join Date
    03-30-2014
    Location
    https://t.me/pump_upp
    MS-Off Ver
    Excel 2013
    Posts
    274

    Re: Filter a Group by Max Value

    Thank you for your help it is always appreciated
    It works as you have done so, however I need to filter on those filtered items, is it possible to add the code to do so ???
    Or tekll me how to filter on those selections
    Regards
    Graham

  4. #4
    Forum Contributor
    Join Date
    03-30-2014
    Location
    https://t.me/pump_upp
    MS-Off Ver
    Excel 2013
    Posts
    274

    Re: Filter a Group by Max Value

    Hi sorry I did not read properly your added text to the request.
    I will add the final files and you will understand then I am sure
    Sorry for the mix up
    Attached Files Attached Files

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Filter a Group by Max Value

    Please Login or Register  to view this content.

  6. #6
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Filter a Group by Max Value

    My guess is you want the entire row results.

    One way to do it.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by bakerman2; 09-20-2021 at 05:43 AM.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  7. #7
    Valued Forum Contributor
    Join Date
    11-04-2018
    Location
    Denpasar
    MS-Off Ver
    Excel 2010
    Posts
    777

    Re: Filter a Group by Max Value

    Please make sure that there is already sheet Sheet2 which is blank.


    Please Login or Register  to view this content.
    The result (as seen in your second attachment Sheet1) is put on Sheet2.
    Last edited by karmapala; 09-20-2021 at 05:56 AM.

  8. #8
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Filter a Group by Max Value

    See my previous post for a slightly enhanced code and example file.

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Filter a Group by Max Value

    Grahamfeeley,

    If you want the result for each row that have max value then no loop needed.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    03-30-2014
    Location
    https://t.me/pump_upp
    MS-Off Ver
    Excel 2013
    Posts
    274

    Re: Filter a Group by Max Value

    Thank you both Kampala and Jindon,while I have known Jindon for many years now helping me out
    So it is all good for both of you and I appreciat it
    Regard
    Graham

  11. #11
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: Filter a Group by Max Value

    An alternative solution is using Power Query.

    Please Login or Register  to view this content.
    Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").

    It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.

    - Follow this link to learn how to install Power Query in Excel 2010 / 2013.

    - Follow this link for an introduction to Power Query functionality.

    - Follow this link for a video which demonstrates how to use Power Query code provided.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

+ 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. How to filter out by group
    By jibberishballr in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 03-22-2023, 04:36 PM
  2. [SOLVED] Group Dates on Pivot Filter
    By JimmyA in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 02-18-2019, 05:37 AM
  3. If filter only one group, no propagation
    By thanhthinh1234 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-26-2018, 07:09 PM
  4. want to filter group soa sales man wise
    By Shermin in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-05-2018, 03:16 PM
  5. Filter not Group
    By mai07 in forum Excel General
    Replies: 2
    Last Post: 05-30-2016, 10:59 AM
  6. Using Filter with Group and Subtotals
    By benrollo13 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-19-2015, 04:38 AM
  7. [SOLVED] Date Filter: Cannot Group that selection
    By enidnunez in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 11-26-2012, 12:30 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