MAXIFS and MINIFS Formula

MAX and MIN look at every number in a range. MAXIFS and MINIFS add conditions, so you can ask for the highest sale in one region or the latest date for one customer.

Free, no sign-up required · 5 free generations a day

Last updated

Describe your task, get the formula

Type what you need in plain English, or pick an example below. You get the formula, a step-by-step explanation, and a worked example.

MAXIFS and MINIFS syntax

Syntax
=MAXIFS(max_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)
=MINIFS(min_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)
=AGGREGATE(14, 6, max_range/(criteria_range=criteria), 1)

MAXIFS and MINIFS exist in Excel 2019, Microsoft 365, and Google Sheets. The AGGREGATE formula is a way to get the same answer in Excel 2016 and earlier without confirming it as an array formula.

Examples

Highest value for one region

=MAXIFS(C:C,B:B,"West")

Looks at column C only on rows where column B equals West and returns the largest number among them.

Lowest value with two conditions

=MINIFS(C:C,A:A,"Widget",B:B,"Jan")

Both conditions must be true for a row to count, so this returns the lowest value for Widget in January.

Most recent date for a customer

=MAXIFS(A:A,B:B,F2)

Dates are numbers, so MAXIFS on the date column returns the latest date for the customer named in F2. Format the cell as a date to read it.

Common mistakes and how to fix them

#NAME? error

MAXIFS and MINIFS are not available in Excel 2016 and earlier. Use =AGGREGATE(14,6,C2:C100/(B2:B100="West"),1) there.

The result is 0 although a value exists

When no row matches, both functions return 0. Check the condition for typos, extra spaces, or numbers stored as text.

#VALUE! because the ranges differ in size

The max range and every criteria range must have the same number of rows. Mixing C2:C100 with B:B causes an error.

Frequently asked questions

How do I get the name that belongs to the maximum value?

Find the maximum with MAXIFS, then look it up: =INDEX(A2:A100,MATCH(MAXIFS(C2:C100,B2:B100,"West"),C2:C100,0)). If several rows share the same maximum you get the first one.

Can I use comparison operators in the condition?

Yes, put the operator in quotes with the value, such as ">100", or join it to a cell reference: ">"&F1.

Is it the same in Google Sheets?

Yes. MAXIFS and MINIFS take the same arguments in Google Sheets.

Don't want to write it by hand?

Describe what you need in plain English and get a ready-to-use formula in seconds.

Try the formula generator