Go Back

How to use the Max if Criteria Match

We often work with ranges in Excel where we need to find the largest value based on certain criteria. The MAX IF criteria match helps us to find the largest value within a range of cells based on a specific condition. In this tutorial, we will learn how to use the MAXIF criteria match in Excel.

Figure 1. Example of Using the Max if Criteria Match

Generic Formula

{=MAX(IF(criteria_range=criteria,value_range))}

  • Criteria_range: This is a required value. It is an array of heterogeneous values contain subsets of homogeneous values. It is the filter boundary.
  • Criteria: This value is required as well. It is the actual value that we check in the criteria range.
  • Value_range: Value_range is also a required value. This is the array list of values. We look to find the largest from this array based on the criteria from the criteria_range.

How this formula works

This formula is based on the MAX and IF functions. First, IF tests whether the criteria_range contains the criteria value. As we compare the criteria with an array, Excel will return an array as the result. This array will contain the logical values TRUE or FALSE. The TRUE values will exist where the criteria exists within the criteria_range. The IF function will return an array consisting of the values from value_range. Here the criteria exists in the criteria_range. Finally, MAX extracts the max value from this array returned by IF.

Setting Up Data

The following example uses a beverage sale data set. Column A, B and C has the beverage names, quantity and sales.

Figure 2. The Sample Beverage Sales Data Set

To find the largest revenue among the beverages in column C:

  • Go to cell F7.
  • Assign the formula =MAX(IF(A2:A20=F6,C2:C20)) to cell F5.
  • Press CTRL + SHIFT + ENTER as it is an array formula.

Figure 3. Applying the Formula to the data

This will show the max sales among the beverages in F7.

Most of the time, the problem you will need to solve will be more complex than a simple application of a formula or function. If you want to save hours of research and frustration, try our live Excelchat service! Our Excel Experts are available 24/7 to answer any Excel question you may have. We guarantee a connection within 30 seconds and a customized solution within 20 minutes.

Did this post not answer your question? Get a solution from connecting with the expert.

Another blog reader asked this question today on Excelchat:
Here are some problems that our users have asked and received explanations on

Index match formula based on IF criteria
Solved by Z. J. in 16 mins
I need to find the max value that matches a certain criteria
Solved by Z. E. in 21 mins
I am using an INDEX MATCH MATCH formula to pull data from a pivot table that meets two criteria. I am NOT using the GETPIVOT formula as the data I am pulling is the row field and not a value. If I do INDEX MATCH to one criteria, the formula works; same if I use the second criteria; however, when I combine in the MATCH MATCH I receive a #REF error. Do you have any insight as to what is causing there error even when each MATCH works separately?
Solved by D. B. in 12 mins

Leave a Comment

avatar