+ Reply to Thread
Results 1 to 6 of 6

Return MAX value based on set criteria

Hybrid View

  1. #1
    Registered User
    Join Date
    12-10-2017
    Location
    Bungendore, NSW Australia
    MS-Off Ver
    2016
    Posts
    28

    Return MAX value based on set criteria

    I am trying to write a formula to return the highest value based on a certain set of criteria.

    Let m explain......

    Screen Shot 2017-12-15 at 13.43.14.png

    Based on the attached screen shot of my spreadsheet. I would like to return the highest value that is in column H, dependant on the values in column D.

    For example, what is the highest value of all of the "A. Lighting" Load Groups.

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,658

    Re: Return MAX value based on set criteria

    Try:
    =MAX(IF($D$10:$D$24="A. Lighting",$H$10:$H$24)
    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    Quang PT

  3. #3
    Registered User
    Join Date
    12-10-2017
    Location
    Bungendore, NSW Australia
    MS-Off Ver
    2016
    Posts
    28

    Re: Return MAX value based on set criteria

    Will the command still be ctrl+shift+enter if i am using a mac?

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,179

    Re: Return MAX value based on set criteria

    Or try:

    =AGGREGATE(14,6,$H$10:$H$24/($D$10:$D$24="A. Lighting"),1)

  5. #5
    Registered User
    Join Date
    12-10-2017
    Location
    Bungendore, NSW Australia
    MS-Off Ver
    2016
    Posts
    28

    Re: Return MAX value based on set criteria

    Thank you that appears to work as I would expect.

    Part two.... How can I get this to work as a conditional formatting rule.

    Example... Instead of returning the max value based on the criteria, I would like to highlight a cell (conditional formatting) based on the result.

    Thanks in advance.

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    19,029

    Re: Return MAX value based on set criteria

    Easiest way that I can think of is to reference the cell with the formula (either Bebo's or Phuocam's) combined with the text value in column D.
    Example if Phuocam's formula is being used in cell X3 and you want to highlight the max value in column H then use the following formula as a conditional formatting rule and applied to your range (ex. H10:H24):
    Formula: copy to clipboard
    =AND(D10="A. Lighting",H10=X$3)

    If more/better explanation is needed please attach a copy of the file from which the screen shot in post #1 was made.
    To attach a sample workbook click on the GO ADVANCED button below the Quick Reply window and then scroll down to Manage Attachments to open the upload window.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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. Return Max or Min value based on criteria
    By san6279 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-01-2017, 07:37 PM
  2. Return a value based on two criteria
    By statlerhale0 in forum Excel General
    Replies: 9
    Last Post: 11-13-2014, 07:28 PM
  3. Return a value based on 2 criteria being met
    By BigPhil84 in forum Excel General
    Replies: 2
    Last Post: 05-19-2014, 07:27 AM
  4. [SOLVED] return a value based upon one of three criteria
    By charles1394 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-14-2012, 01:02 AM
  5. Return name based on 2 criteria
    By QUESTIONS123 in forum Excel General
    Replies: 3
    Last Post: 04-10-2012, 11:03 PM
  6. Return 1st, 2nd, 3rd, etc value based on criteria
    By waddsn1060 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-01-2011, 04:28 PM
  7. Return value based off 2 criteria.
    By iamdavid in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-11-2010, 05:37 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