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 This formula uses two nested IF functions, wrapped inside MAX to return the maximum 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: 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: The “value if true” for the 2nd IF statement is the named range “prices” (E6:E14), which is an array like this: 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: Note the only prices that “survive” are those in a position where the color is “red” and item is “hat”. The MAX function then returns the highest price, automatically ignoring FALSE values.

### Alternative syntax using boolean logic

You can also use the following array formula, which uses only one IF function together with boolean logic: 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: Note: MAXIFS will automatically ignore empty cells that meet criteria. In other words, MAXIFS will not treat empty cells that meet criteria as zero. On the other hand, MAXIFS will return zero (0) if no cells match criteria.

### Dave Bruns

Hi - I’m Dave Bruns, and I run Exceljet with my wife, Lisa. Our goal is to help you work faster in Excel. We create short videos, and clear examples of formulas, functions, pivot tables, conditional formatting, and charts.