
The MAXIFS and MINIFS functions in Excel return the largest or smallest number that meets one or more conditions. For example, =MAXIFS(C2:C50, A2:A50, "East") gives the highest value in column C among the rows where column A is "East". Both functions are available in Excel 2019 and in Excel 365. They are not in Excel 2016 or earlier. This guide covers the syntax, examples with several conditions, dates and wildcards, and the fixes for common errors. The sample data is made up.
Syntax
=MAXIFS(max_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)
=MINIFS(min_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)
- max_range / min_range is the column of numbers to look through.
- criteria_range is the column to test.
- criteria is the condition, such as "East", ">100" or a cell reference.
Every criteria range must have the same size as the max or min range, or you get a #VALUE! error.

Highest value for one condition
With regions in A2:A50 and sales in C2:C50:
=MAXIFS(C2:C50, A2:A50, "East")

Lowest value for one condition
=MINIFS(C2:C50, A2:A50, "East")
Use a cell for the condition
Put the region name in F1 and point to it, so the answer changes when you change F1:
=MAXIFS(C2:C50, A2:A50, F1)
Several conditions
Add more pairs. To find the highest East sale for the product "Desk" (products in B):
=MAXIFS(C2:C50, A2:A50, "East", B2:B50, "Desk")
All conditions must be true at once. This works like the criteria in COUNTIFS.
Conditions with operators
To find the smallest sale that is still above 100, put the operator in quotes:
=MINIFS(C2:C50, C2:C50, ">100")
To use a cell in a comparison, join the pieces: ">" & F2.

Between two dates
To find the highest sale in a date range, with dates in D2:D50, a start date in G1 and an end date in G2:
=MAXIFS(C2:C50, D2:D50, ">=" & G1, D2:D50, "<=" & G2)
A similar pattern for totals is shown in SUMIFS between two dates.
Wildcards
You can match part of a text with * and ?. For example "Desk*" matches every product that starts with "Desk". The wildcard characters guide explains the symbols.
What if nothing matches?
When no row meets the conditions, MAXIFS and MINIFS return 0, not an error. That can look like a real result. To show a message instead, check with COUNTIFS first: =IF(COUNTIFS(A2:A50,"East")=0, "No match", MAXIFS(C2:C50, A2:A50, "East")).

Get the name that goes with the maximum
MAXIFS returns the number only. To get the name in column B for that number, look it up with XLOOKUP using the result. If two rows share the same maximum, you get the first one. See the XLOOKUP guide.
In older versions of Excel
If your Excel has no MAXIFS, use an array formula such as =MAX(IF(A2:A50="East", C2:C50)) and confirm it with Ctrl+Shift+Enter. In Excel 365 it works with a normal Enter.
Common errors
- #VALUE! The ranges have different sizes.
- #NAME? Your Excel version does not include the function.
- Result is 0. No row matched, or the numbers are stored as text.
- Wrong result with dates. The dates are text. Convert them to real dates.
Questions and answers
What is the difference between MAXIFS and MAX with IF?
MAXIFS is shorter and needs no array entry. MAX with IF works in older versions.
Do MAXIFS and MINIFS work in Google Sheets?
Yes. Google Sheets has MAXIFS and MINIFS with the same arguments.
Are the criteria case sensitive?
No, text criteria ignore case in these functions.
How many conditions can I add?
Microsoft documents up to 126 pairs of criteria range and criteria.
