+ Reply to Thread
Results 1 to 9 of 9

Filtering based on multiple columns

Hybrid View

  1. #1
    Registered User
    Join Date
    07-01-2015
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    4

    Filtering based on multiple columns

    I have a large spreadsheet with test data and I'm trying to extract rows with max values. The below example will help explain better

    To start I have a table like this, each cycle has multiple readings and I only want the readings from the max "Cap Ah" values.
    Cycle Cap Ah V A
    1 0.3 a b
    1 0.8 c d
    2 1 e f
    2 1.2 f g
    3 0.2 h i
    3 0.8 k m

    The end result would look like this
    Cycle Cap Ah V A
    1 0.8 c d
    2 1.2 f g
    3 0.8 k m

    I can't figure out where to start with this, I have thousands of rows so doing it manually isn't an options.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,119

    Re: Filtering based on multiple columns

    Use an AutoFilter. It has an option for "Top 10" but you can adjust the number that you want.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    07-01-2015
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    4

    Re: Filtering based on multiple columns

    Quote Originally Posted by TMS View Post
    Use an AutoFilter. It has an option for "Top 10" but you can adjust the number that you want.
    Thanks for your reply TMS. The filter does give me the highest values but I need it restricted to only one for each Cycle. In the above example, for Top 3 it'd give me rows 3,4,5 instead of row 3,5,9

  4. #4
    Forum Contributor
    Join Date
    07-06-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2016
    Posts
    192

    Re: Filtering based on multiple columns

    Hi, I have attached a sample for you. see if it works out for you.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    07-01-2015
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    4

    Re: Filtering based on multiple columns

    Quote Originally Posted by finalazy View Post
    Hi, I have attached a sample for you. see if it works out for you.
    Thanks for your reply, I appreciate the time you spent developing the example.

    This works exactly as I need it but seems to break after 1000 rows. When I change =MAX(IF($A$2:$A$1000=F2,$B$2:$B$1000,"")) to =MAX(IF($A$2:$A$3000=F2,$B$2:$B$3000,"")) to include more rows it comes up with #VALUE! error. The Cycle column is fine but Cap Ah error's out. I've tried lots of combinations but can't figure out why that error comes up when the rows are increased

  6. #6
    Forum Contributor
    Join Date
    07-06-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2016
    Posts
    192

    Re: Filtering based on multiple columns

    Did you ctrl shift enter after you change the row number? Its an array formula.
    Last edited by finalazy; 02-09-2018 at 11:32 AM.

  7. #7
    Registered User
    Join Date
    07-01-2015
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    4

    Re: Filtering based on multiple columns

    Thanks finalazy, that was it. It's working as I need it.

    Thank you very much for your help.

  8. #8
    Forum Contributor
    Join Date
    07-06-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2016
    Posts
    192

    Re: Filtering based on multiple columns

    Quote Originally Posted by shahab.arif View Post
    Thanks finalazy, that was it. It's working as I need it.

    Thank you very much for your help.
    Glad it helps. You are welcome =)

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,387

    Re: Filtering based on multiple columns

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

+ 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. Filtering from multiple columns
    By mjs188 in forum Excel General
    Replies: 4
    Last Post: 11-05-2017, 04:36 PM
  2. [SOLVED] VBA Filtering Columns based on Cell Value for multiple columns
    By MikeRoot in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-31-2014, 08:07 AM
  3. Filtering multiple Columns
    By QZJ00 in forum Excel General
    Replies: 4
    Last Post: 10-16-2012, 11:54 PM
  4. Replies: 5
    Last Post: 10-01-2010, 05:00 AM
  5. filtering based on multiple columns within a range.
    By CJPHX in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-04-2010, 03:02 AM
  6. Filtering multiple columns
    By shwin in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-06-2007, 06:06 PM
  7. Filtering on multiple columns
    By wammer in forum Excel General
    Replies: 4
    Last Post: 08-29-2005, 06:21 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