Find a Maximum with Multiple Criteria
Return the largest value from rows meeting both a category and numeric boundary, while exposing the qualifying population and distinguishing no matches from a genuine zero.
| Maximum If Multiple Criteria, Formula Review | |||||||||
| MAXIFS applies range criteria directly; a helper column makes the qualifying population visible. | |||||||||
| Local source and qualifying-value audit | Criteria, editable | ||||||||
| Name | Group | Temperature | Value | Qualifying value | Control | Value | |||
| Avery | A | 68 | 83 | 83 | Selected group | A | |||
| Blake | B | 70 | 91 | Temperature < | 73 | ||||
| Drew | A | 72 | 88 | 88 | MAXIFS result | 88 | |||
| Gray | A | 74 | 95 | Audit MAX | 88 | ||||
| Jordan | A | 70 | 86 | 86 | |||||
| Kai | A | 73 | 90 | ||||||
| Representative formula | |||||||||
| =MAXIFS(value_range,group_range,selected_group,temp_range,"<"&limit) | |||||||||
Overview
Return the largest Value from rows belonging to a selected Group and falling below an editable Temperature limit. A helper column exposes the qualifying values, and a separate count distinguishes an empty population from a valid maximum of zero.
When to use it
Use it for peak values within a segment, largest exceptions below a risk limit, maximum performance under a capacity constraint, or a conditional dashboard callout. The source must contain aligned criteria and candidate-value columns.
When not to use it
Use SORT and FILTER when users need every qualifying record ranked rather than one value. Use MAX(FILTER(...)) when eligibility requires dynamic-array transformations. A legacy MAX/IF array formula is needed where MAXIFS is unavailable.
Problem
Taking the overall maximum before applying criteria can select an excluded row. MAXIFS also returns zero when nothing matches, which is indistinguishable from a genuine qualifying zero unless the population count is shown separately.
Inputs
Input | Location | Sample |
|---|---|---|
Selected group | | A |
Temperature limit | | 73, exclusive |
Source data
The synthetic source is in Combined Example!A12:D23. The Group A records are:
Name | Temperature | Value | Qualifies? |
|---|---|---|---|
Avery | 68 | 83 | Yes |
Drew | 72 | 88 | Yes |
Gray | 74 | 95 | No |
Jordan | 70 | 86 | Yes |
Kai | 73 | 90 | No |
Each row is one observation. Maximum and criteria ranges must cover identical rows. Blank candidate values are ignored; duplicates can qualify independently.
Calculations
- Restrict rows to the selected Group.
- Apply the exclusive Temperature boundary.
- Return qualifying Values in a visible helper column.
- Calculate the primary result with MAXIFS.
- Count qualifying rows with COUNTIFS.
- Reconcile MAXIFS to MAX of the helper values.
Outputs
Three rows qualify, with Values 83, 88, and 86. The maximum is therefore 88. The higher source Value of 95 is excluded because its Temperature is 74, and the Value of 90 at exactly 73 is excluded by the strict <73 rule.
Formula map
Conditional maximum
=MAXIFS(D12:D23,B12:B23,H12,C12:C23,"<"&H13)
Visible qualifying-value audit
=IF(AND(B12=$H$12,C12<$H$13),D12,"")
Fill the helper formula down. The operator and threshold are concatenated in MAXIFS, while the helper expresses the same boundary directly.
Model checks
The workbook confirms that MAXIFS equals MAX of the visible helper column and that the qualifying row count equals three. Passing controls return OK.
Edge cases
- A Temperature equal to 73 is excluded; use
<=for an inclusive limit. - A larger Value outside either criterion does not affect the result.
- Blank candidate Values are ignored.
- No matching rows return zero from MAXIFS; interpret it alongside COUNTIFS.
- Misaligned maximum and criteria ranges cause an error or invalidate row correspondence.
- A genuine qualifying zero is valid when the count is positive.
Common errors
- Using the wrong boundary operator: eligibility changes at the threshold. Align MAXIFS and helper logic.
- Treating zero as proof of a match: no-match and zero-value cases are confused. Retain the qualifying count.
- Taking MAX first: an excluded row wins. Apply every condition before the aggregation.
Example
For Group A below 73, Values 83, 88, and 86 qualify. MAX(83,88,86) is 88, matching MAXIFS. Values 95 at 74 and 90 at exactly 73 are excluded, independently confirming both the group and strict-boundary logic.
Example workbook
Replace the cream criteria in Combined Example!H12:H13 or edit the 12 source rows in A12:D23. The helper column, qualifying count, maximum, and checks update together. Formula Review isolates the strict boundary and audit calculation.
Key takeaway
Define the qualifying population before taking its maximum, and pair MAXIFS with a count when zero could mean either no matches or a valid result.