Skip to content

MINIFS

Returns the smallest value in a range among the rows that meet one or more conditions, such as the lowest price for one item.

Syntax

=MINIFS(, , , [criteria_range2, criteria2], ...)

Statistical

Excel 2019, Excel 2021, Excel 2024, Excel for Microsoft 365 and Excel for the web. Not in the perpetual versions Excel 2016 and earlier.

Try it

Edit the formula in C11 or change the inputs. The sheet recalculates as you type.

C11
A
B
C
1
Item
Supplier
Price
2
Gloves
Apex
8.95
3
Tape
Apex
2.40
4
Gloves
Brill
8.60
5
Labels
Brill
5.10
6
Tape
Cobb
2.25
7
Gloves
Cobb
9.10
8
Labels
Apex
5.40
9
Tape
Brill
0.00
10
11
Cheapest gloves
8.60

C11 =MINIFS(C2:C9,A2:A9,"Gloves") returns 8.60

How MINIFS works

MINIFS finds the smallest number among the rows that pass your tests. Use it for "cheapest price for this item", "shortest lead time from approved suppliers" or "earliest date for this customer".

Argument order

The range to take the minimum from comes first, then pairs of test range and condition:

=MINIFS(C2:C9, A2:A9, "Tape", B2:B9, "<>Cobb")

This matches MAXIFS, AVERAGEIFS and COUNTIFS. Every criteria range must be the same size and shape as min_range, or MINIFS returns #VALUE!. All conditions must be true for a row to count.

Conditions on the same column

The min_range can be one of the test ranges. That is how you find the smallest value that is not zero:

=MINIFS(C2:C9, C2:C9, ">0")

This matters because a plain MIN returns 0 whenever 0 stands for "no price" or "no data". With the ">0" condition, MINIFS skips those rows and finds the lowest real value.

When nothing matches

If no row meets every condition, MINIFS returns 0, not an error. That is hard to tell from a real zero. If the answer could be confused, test the count first: =IF(COUNTIFS(A2:A9,"Wire")=0,"No rows",MINIFS(C2:C9,A2:A9,"Wire")).

Criteria

Criteria work as they do in COUNTIF. A plain value matches whole cells and ignores case. Comparisons go in quotes with their operator (">0", "<>Cobb"). Wildcards * and ? work on text. A cell reference reads its current value, and "<"&E2 joins an operator to a cell.

Excel 2016 and earlier

MINIFS is not available before Excel 2019, and shows #NAME? there. In older versions use =MIN(IF(A2:A9="Tape",C2:C9)) confirmed with Ctrl+Shift+Enter, or =AGGREGATE(15,6,C2:C9/(A2:A9="Tape"),1). In Microsoft 365 the MIN(IF(...)) version works as typed.

For the smallest value with no conditions, use MIN. For the second or third smallest, use SMALL.

Arguments

min_range
The cells to take the minimum from, such as C2:C9.
criteria_range1
The first range to test, such as A2:A9. It must be the same size and shape as min_range.
criteria1
The first condition: a value, a cell reference or an expression such as ">0", "<>Cobb" or "Tap*". Text and operators go in quotes.
criteria_range2, criteria2, ...optional
More pairs of range and condition, up to 126 pairs. A row is considered only when it passes every condition.

Examples

Each example is a live sheet. Change the inputs or the formula and watch the result.

Example 1

Cheapest price for one item

C11 =MINIFS(C2:C9,A2:A9,"Gloves")

Result: 8.60

Three suppliers quote gloves: 8.95, 8.60 and 9.10. The smallest is 8.60.

C11
A
B
C
1
Item
Supplier
Price
2
Gloves
Apex
8.95
3
Tape
Apex
2.40
4
Gloves
Brill
8.60
5
Labels
Brill
5.10
6
Tape
Cobb
2.25
7
Gloves
Cobb
9.10
8
Labels
Apex
5.40
9
Tape
Brill
0.00
10
11
Cheapest gloves
8.60

C11 =MINIFS(C2:C9,A2:A9,"Gloves") returns 8.60

Example 2

Skip zeros that mean "no quote"

C11 =MINIFS(C2:C9,A2:A9,"Tape",C2:C9,">0")

Result: 2.25

Brill's price of 0 means no quote was given. Without the ">0" condition, the answer would be 0.

C11
A
B
C
1
Item
Supplier
Price
2
Gloves
Apex
8.95
3
Tape
Apex
2.40
4
Gloves
Brill
8.60
5
Labels
Brill
5.10
6
Tape
Cobb
2.25
7
Gloves
Cobb
9.10
8
Labels
Apex
5.40
9
Tape
Brill
0.00
10
11
Cheapest tape
2.25

C11 =MINIFS(C2:C9,A2:A9,"Tape",C2:C9,">0") returns 2.25

Example 3

Exclude one supplier

C11 =MINIFS(C2:C9,A2:A9,"Tape",B2:B9,"<>Cobb",C2:C9,">0")

Result: 2.40

Excluding Cobb and the zero quote leaves only Apex at 2.40.

C11
A
B
C
1
Item
Supplier
Price
2
Gloves
Apex
8.95
3
Tape
Apex
2.40
4
Gloves
Brill
8.60
5
Labels
Brill
5.10
6
Tape
Cobb
2.25
7
Gloves
Cobb
9.10
8
Labels
Apex
5.40
9
Tape
Brill
0.00
10
11
Cheapest tape, not Cobb
2.40

C11 =MINIFS(C2:C9,A2:A9,"Tape",B2:B9,"<>Cobb",C2:C9,">0") returns 2.40

Example 4

No matching rows returns 0

C11 =MINIFS(C2:C9,A2:A9,"Wire")

Result: 0.00

No row is for Wire, so MINIFS returns 0 instead of an error.

C11
A
B
C
1
Item
Supplier
Price
2
Gloves
Apex
8.95
3
Tape
Apex
2.40
4
Gloves
Brill
8.60
5
Labels
Brill
5.10
6
Tape
Cobb
2.25
7
Gloves
Cobb
9.10
8
Labels
Apex
5.40
9
Tape
Brill
0.00
10
11
Cheapest wire
0.00

C11 =MINIFS(C2:C9,A2:A9,"Wire") returns 0.00

Your turn.

Solve it in the sheet. Every answer is checked, with hints if you need them.

Task 1 of 2

In F2, return the lowest price quoted for the item named in E2.

Answer in F2.

F2
A
B
C
D
E
F
1
Item
Supplier
Price
Item
Lowest price
2
Pallet wrap
Apex
14.50
Pallet wrap
3
Cable ties
Brill
3.20
4
Pallet wrap
Brill
13.80
Excluding Cobb
5
Cable ties
Apex
3.55
6
Pallet wrap
Cobb
15.10
7
Cable ties
Cobb
2.95
8
Strapping
Apex
21.00
9
Strapping
Brill
19.75

Common mistakes

  • When no row matches, MINIFS returns 0, which looks like a real price. Check with COUNTIFS first when that could mislead.
  • Zeros that stand for "no data" win every minimum. Add a ">0" condition on the same range to skip them.
  • #VALUE! means the criteria ranges are different sizes from min_range. Make every range start and end on the same rows.
  • MINIFS shows #NAME? in Excel 2016 and earlier. Use MIN(IF(...)) or AGGREGATE in files that have to open there.
  • Numbers stored as text in min_range are ignored, so the result can be higher than the true minimum.

Questions people ask

How do I find the smallest value above zero?

Use `=MINIFS(C2:C9,C2:C9,">0")`. The same range is both the values to minimise and the condition.

Does MINIFS work in Excel 2016?

No. It arrived in Excel 2019 and Microsoft 365. In older versions use `=MIN(IF(A2:A9="Tape",C2:C9))` confirmed with Ctrl+Shift+Enter.

Why does MINIFS return 0 when I expect a number?

Either a zero in the data is the smallest matching value, or no row matched. Check spelling and spaces in the criteria, and add `">0"` if zeros mean "no data".

How do I find which supplier has the lowest price?

Find the minimum with MINIFS, then look it up: `=XLOOKUP(1,(A2:A9="Tape")*(C2:C9=C11),B2:B9)` in Microsoft 365, where C11 holds the MINIFS result.

Learn MINIFS in a real sheet.

MINIFS is taught in Data analysis with formulas, lesson 6: MAXIFS and MINIFS. Each lesson is a short, graded exercise like the one above.