Skip to content
xlsoffice. All Rights Reserved
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Lookup and Reference Examples

  • Extract data with helper column in Excel
  • LOOKUP function: Description, Usage, Syntax, Examples and Explanation
  • Count unique text values with criteria
  • How to use Excel MMULT Function
  • How to reference named range different sheet in Excel

Data Analysis Examples

  • Reverse List in Excel
  • How To Insert and Customize Sparklines in Excel
  • How to create running total in an Excel Table
  • Everything about Charts in Excel
  • Conditional Formatting Rules in Excel

Data Validation Examples

  • Excel Data validation only dates between
  • Excel Data validation allow weekday only
  • Excel Data validation require unique number
  • Excel Data validation with conditional list
  • Excel Data validation don’t exceed total

Maximum if multiple criteria in Excel

by

This tutorial shows how to calculate Maximum if multiple criteria in Excel using the example below;

Formula

{=MAX(IF(rng1=criteria1,IF(rng2=criteria2,values)))}

Explanation

To get the maximum value in a data set based on more than one criteria (i.e. to get MAX IF), you can use an array formula based on the MAX and IF functions. In the example shown, the formula in I6 is:

{=MAX(IF(color=G6,IF(item=H6,price)))}

With a color of “red” and item of “hat” the result is $11.00

Note: This is an array formula and must be entered using Ctrl + Shift + entered

How this formula works

This example uses the following named ranges: “color” = B6:B14, “item” = C6:C14, and “price” = E6:E14. The goal is to find the maximum price for a given color and item.

Worked Example:   How To Use MaxIfs and MinIfs in Excel

This formula uses two nested IF functions, wrapped inside MAX to return the minimum price with two criteria. Starting with a logical test of the first IF statement, color = G6, the values in the named range color (B6:B14) are checked against the value in cell G6, “red”. The result is an array like this:

{TRUE;TRUE;TRUE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE}

In the logical test for the second IF statement, item = H6, the values in the named range item (C6:C14) are checked against the value in cell H6, “hat”. The result is an array like this:

{TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;FALSE;FALSE;FALSE}

The “value if true” for the 2nd IF statement is the named range “prices” (E6:E14), which is an array like this:

{11;8;9;12;9;10;9;8;7}

A price is returned for each item in this range only when the result of the first two arrays above is TRUE for items in corresponding positions. In the example shown, the final array inside of MAX looks like this:

{11;8;9;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE}

Note the only prices that “survive” are those in a position where the color is “red” and item is “hat”.

Worked Example:   First in, last out times in Excel

The MAX function then returns the highest price, automatically ignoring FALSE values.

Worked Example:   Max value ignore all errors in Excel

Alternative syntax using boolean logic

You can also use the following array formula, which uses only one IF function together with boolean logic:

{=MAX(IF((color=G6)*(item=H6),price))}

The advantage of this syntax is that it is easier to add additional criteria without adding additional nested IF functions. If you need OR logic, use addition instead of multiplication between conditions.

With MAXIFS

The MAXIFS function, introduced in Excel 2016, is designed to calculate maximums based on one or more criteria without the need for an array formula. With MAXIFS, the formula in I6 is:

=MAXIFS(price,color,G6,item,H6)

Post navigation

Previous Post:

Max value ignore all errors in Excel

Next Post:

Maximum value in Excel

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Learn Basic Excel

Ribbon
Workbook
Worksheets
Format Cells
Find & Select
Sort & Filter
Templates
Print
Share
Protect
Keyboard Shortcuts

Categories

  • Charts
  • Data Analysis
  • Data Validation
  • Excel Functions
    • Cube Functions
    • Database Functions
    • Date and Time Functions
    • Engineering Functions
    • Financial Functions
    • Information Functions
    • Logical Functions
    • Lookup and Reference Functions
    • Math and Trig Functions
    • Statistical Functions
    • Text Functions
    • Web Functions
  • Excel VBA
  • Excel Video Tutorials
  • Formatting
  • Grouping
  • Others
  • Find most frequent text within a range with criteria in Excel
  • Two ways to Compare Text in Excel
  • UPPER function: Description, Usage, Syntax, Examples and Explanation
  • How to check if cell contains some words but not others in Excel
  • How to find nth occurrence of character in Excel
  • Custom weekday abbreviation in Excel
  • MINUTE function: Description, Usage, Syntax, Examples and Explanation
  • Get work hours between dates and times in Excel
  • Convert date to Julian format in Excel
  • Add decimal hours to time in Excel
  • PRICE function: Description, Usage, Syntax, Examples and Explanation
  • COUPPCD function: Description, Usage, Syntax, Examples and Explanation
  • ODDLYIELD function: Description, Usage, Syntax, Examples and Explanation
  • RRI function: Description, Usage, Syntax, Examples and Explanation
  • CUMIPMT function: Description, Usage, Syntax, Examples and Explanation
© 2022 xlsoffice . All Right Reserved. | Teal Smiles