+ Reply to Thread
Results 1 to 6 of 6

Finding minimum and maximum values based on multiple criteria and filtered data

  1. #1
    Registered User
    Join Date
    01-23-2013
    Location
    Frederick, Maryland
    MS-Off Ver
    Excel 2007
    Posts
    6

    Finding minimum and maximum values based on multiple criteria and filtered data

    I have a request to find the min and max values from a range. First the list needs to be narrowed down using criteria based on other columns of data. It then needs to only show the data in that has been filtered. Finding the min and max based on the other columns of data I can find using Min(if((range1="x")*(range2="y"),range3)) and I can find the filtered data using subtotal(105,range3). Doing a search I found using SUMPRODUCT would work which it does if there is only one criteria. Adding the second range of criteria causes the values to be added together. Any ideas?

  2. #2
    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,969

    Re: Finding minimum and maximum values based on multiple criteria and filtered data

    hard to say without seeing samples of what you have and what you want
    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

  3. #3
    Registered User
    Join Date
    01-23-2013
    Location
    Frederick, Maryland
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Finding minimum and maximum values based on multiple criteria and filtered data

    Quote Originally Posted by FDibbins View Post
    hard to say without seeing samples of what you have and what you want
    Well if I could find the paper clip I'd attach a worksheet. Here's a picture of what I mean.

    Filtered Worksheet.jpg

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Finding minimum and maximum values based on multiple criteria and filtered data

    Here's an example...

    Data Range
    A
    B
    C
    D
    E
    F
    G
    4
    ------
    ------
    ------
    ------
    ------
    ------
    ------
    5
    Region
    Status
    Value
    North
    Yes
    39
    6
    East
    No
    52
    7
    East
    No
    86
    8
    East
    No
    90
    9
    East
    Yes
    76
    10
    North
    No
    8
    11
    North
    No
    94
    12
    North
    Yes
    39
    13
    North
    Yes
    81
    14
    South
    No
    3
    15
    South
    No
    10
    16
    South
    No
    31
    17
    South
    Yes
    27
    18
    South
    Yes
    31
    19
    South
    Yes
    74
    20
    South
    Yes
    75
    21
    South
    Yes
    83
    22
    West
    No
    10
    23
    West
    No
    31
    24
    West
    No
    33
    25
    West
    No
    93
    26
    West
    Yes
    24
    27
    West
    Yes
    45


    We want the min value for Region = North and Status = Yes of a filtered (or unfiltered) list.

    This array formula** entered in G5:

    =MIN(IF(SUBTOTAL(2,OFFSET(C6,ROW(C6:C27)-ROW(C6),0)),IF(A6:A27=E5,IF(B6:B27=F5,C6:C27))))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    I have the data sorted just to make it easy to find the correct result.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Registered User
    Join Date
    01-23-2013
    Location
    Frederick, Maryland
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Finding minimum and maximum values based on multiple criteria and filtered data

    Thanks Tony. That worked perfectly! Not sure how to mark the correct answer on here. Thanks again.

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Finding minimum and maximum values based on multiple criteria and filtered data

    You're welcome. Thanks for the feedback!

    We don't mark correct answers here. We just ask that if your question was solved then mark the thread as being solved which you have already done!

+ 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. Minimum, Maximum, Mean and Median for data set with Multiple Criteria
    By Stewbart13 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-30-2013, 03:03 PM
  2. Maximum and Minimum values from data stream
    By casery in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-27-2013, 09:25 PM
  3. Replies: 11
    Last Post: 01-02-2013, 10:14 AM
  4. [SOLVED] vba to get the minimum and maximum values based on a unique ID
    By alexbotea2005 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-31-2012, 02:44 PM
  5. Maximum & Minimum values - filtered columns across sheets
    By naik in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-06-2011, 12:10 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