+ Reply to Thread
Results 1 to 8 of 8

Find MAX value within a subset of a range

Hybrid View

  1. #1
    Registered User
    Join Date
    01-04-2019
    Location
    Mountain View, CA
    MS-Off Ver
    Microsoft 365; Excel for Mac 16.64
    Posts
    22

    Find MAX value within a subset of a range

    I have a spreadsheet that contains multiple columns with prices (I have defined the range as "Sale_Prices"). I can determine the lowest price in the Sale_Prices range using the MIN function. I now want to find the highest price in the spreadsheet that is no more than $0.99 higher than the lowest price (essentially, I will need to group the prices into $1 ranges). Any help in writing that formula would be appreciated. I would prefer to avoid array formulas if possible.

    A sample spreadsheet is attached. The data is in the "Raw Data" tab and the formula should go in cell B4 of the "Calcs" tab. Thanks!
    Attached Files Attached Files

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,426

    Re: Find MAX value within a subset of a range

    Do you have the MAXIFS function in your version of Excel? (Sorry, I'm not familiar with Excel for Mac versions). If so, you could use that instead of an array formula which would use MAX(IF( …

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    01-04-2019
    Location
    Mountain View, CA
    MS-Off Ver
    Microsoft 365; Excel for Mac 16.64
    Posts
    22

    Re: Find MAX value within a subset of a range

    Yes, I do have the MAXIFS function. I tried this formula:

    =MAXIFS(Sale_Prices, Sale_Prices,"<="&B3)

    but it returns a#VALUE! error. Maybe it doesn't like the fact that the MAX range and the criteria range are the same. Any thoughts? Thanks.

  4. #4
    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. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    91,031

    Re: Find MAX value within a subset of a range

    The named range is not a single column - it's three columns. Try this instead:

    =MAXIFS('Raw Data'!$A$4:$B$133, 'Raw Data'!$A$4:$B$133,"<="&B3)
    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.

  5. #5
    Registered User
    Join Date
    01-04-2019
    Location
    Mountain View, CA
    MS-Off Ver
    Microsoft 365; Excel for Mac 16.64
    Posts
    22

    Re: Find MAX value within a subset of a range

    Thanks, but I need it to look across columns A, C, E and G, not columns A and B. And I don't want to define specific range in these columns, because the spreadsheet will be a template into which other people will copy data, and number of rows used will vary.

  6. #6
    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. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    91,031

    Re: Find MAX value within a subset of a range

    Then you can't use MAXIFS.

    I'm not completely clear what you are trying to achieve, but it will probably need a SUMPRODUCT.

  7. #7
    Registered User
    Join Date
    01-04-2019
    Location
    Mountain View, CA
    MS-Off Ver
    Microsoft 365; Excel for Mac 16.64
    Posts
    22

    Re: Find MAX value within a subset of a range

    It's not the most elegant solution, but the following seems to work:

    =MAX(MAXIFS('Raw Data'!A:A, 'Raw Data'!A:A,"<="&B3),MAXIFS('Raw Data'!C:C, 'Raw Data'!C:C,"<="&B3),MAXIFS('Raw Data'!E:E, 'Raw Data'!E:E,"<="&B3),MAXIFS('Raw Data'!G:G, 'Raw Data'!G:G,"<="&B3))

    Thanks for the help, Pete_UK and AliGW!

  8. #8
    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. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    91,031

    Re: Find MAX value within a subset of a range

    Thanks for letting us know.

+ 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. Find within a subset of data from -- what approach is best?
    By learning new things in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 08-19-2018, 05:50 AM
  2. Replies: 1
    Last Post: 03-14-2016, 12:31 AM
  3. [SOLVED] Help on Multiple Criteria lookup to find MIN value within subset of data
    By nzxt1234 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-01-2015, 04:15 PM
  4. [SOLVED] defining a range subset based on a primary range for use in Median and Mode functions
    By Araise in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-06-2013, 06:39 PM
  5. Subset a range for array multiplication
    By mpm166 in forum Excel General
    Replies: 5
    Last Post: 04-16-2012, 06:57 PM
  6. Named range - subset
    By jlt199 in forum Excel General
    Replies: 7
    Last Post: 08-17-2010, 08:48 AM
  7. How to enter symbols for subset or element of a subset in Excel?
    By rwcita in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-23-2006, 05: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