Statistical functions

MINIFS

Matches all 13 recorded answers

Recorded: 13 workbook cells. How we measure this · See the Rust code

Local names in 40 languages
LanguageName in Excel
ArabicMINIFS
BulgarianMINIFS
CzechMINIFS
DanishMINHVISER
GermanMINIFS
GreekMINIFS
English (Australia)MINIFS
English (United Kingdom)MINIFS
English (United States)MINIFS
SpanishMIN.SI.CONJUNTO
EstonianMINIFS
FinnishMIN.JOS.JOUKKO
FrenchMIN.SI.ENS
HebrewMINIFS
CroatianMINIFS
HungarianMINHA
IndonesianMINIFS
ItalianMINIFS
JapaneseMINIFS
KoreanMINIFS
LithuanianMINIFS
LatvianMINIFS
NorwegianMINIFS
DutchMIN.ALS.VOORWAARDEN
PolishMIN.WARUNKÓW
Portuguese (Brazil)MINIFS
Portuguese (Portugal)MÍNIMO.SE.S
RomanianMINIFS
RussianМИНЕСЛИ
SlovakMINIFS
SlovenianMINIFS
Serbian (Latin)MINIFS
SwedishMINIFS
ThaiMINIFS
TurkishÇOKEĞERMİN
UkrainianMINIFS
VietnameseMINIFS
Chinese (Simplified)MINIFS
Chinese (Hong Kong)MINIFS
Chinese (Traditional)MINIFS

Names from Microsoft's support site.

What it does

MINIFS(min_range, criteria_range1, criteria1, [criteria_range2], [criteria2], ...)

MINIFS(min_range, criteria_range1, criteria1, [criteria_range2, criteria2], …) returns the smallest value among the cells of min_range whose correspondingly-positioned cells in every criteria range satisfy the matching criterion.

With i ranging over positions in the common shape:

S = { i : P₁(criteria_range1[i]) ∧ … ∧ P_k(criteria_range_k[i]) }
MINIFS = min { min_range[i] : i ∈ S, min_range[i] is numeric }

Two structural facts:

  1. Criteria pairs combine with AND, positionally. There is no OR form inside a single call. The link between a criteria cell and a min_range cell is position, which is why the shapes must agree. Microsoft's page adds a clarification worth quoting: the ranges "don't need to be aligned, only the same shape/size" — they may sit anywhere on the sheet, and correspondence is by offset within each range, not by row number.
  2. MINIFS is a selection stage followed by a reduction. The selection is shared with the whole criteria family and carries a comparison-predicate question; the reduction is shared with MIN and carries the empty-set question. The two halves fail differently and are worth separating.

Domain and result. min_range may hold anything; only its numeric cells participate. When S is empty, Microsoft documents that the function returns 0.

Arguments

ArgumentMeaningRequired
min_range"The actual range of cells in which the minimum value will be determined."Yes
criteria_range1"Is the set of cells to evaluate with the criteria."Yes
criteria1"Is the criteria in the form of a number, expression, or text that defines which cells will be evaluated as minimum."Yes
criteria_range2, criteria2, …Additional range/criteria pairs; up to 126 pairsNo

Shape, not count. A 3×1 min_range against a 1×3 criteria range is a mismatch even though both hold three cells. Microsoft documents #VALUE! for that case.

Try it

Input cells (optional)

Example: {"B2": 3, "B3": 4}. A1 holds the formula. Other cells need values before a formula can read them.

Enter a formula, then calculate.

Runs locally in your browser with OneCalc. Its answer may differ from Excel. Use English function names and commas between arguments.

Quirks

The criteria language

The criteria argument is the family's shared mini-language, and Microsoft's page says the matching works consistently with MAXIFS, SUMIFS and AVERAGEIFS. The parts that bear on MINIFS specifically:

  • A bare number or text is an equality test.
  • A text criterion may begin with a comparison operator — ">5", "<>x", "<="&A1 — which is parsed out of the string.
  • Wildcards ? and * apply to text criteria, with ~ as the escape.
  • An empty criteria cell is treated as zero, documented. MINIFS(B:B, A:A, C1) with C1 blank does not mean "no filter"; it means "equal to zero".

Result and edge cases

Returns Number.

This convention is more dangerous on MINIFS than on MAXIFS, for the same reason it is more dangerous on MIN than on MAX. Most spreadsheet data is positive. A MINIFS of 0 over positive data means either "nothing matched" or "the smallest matching value is zero", and the two are indistinguishable — but the first is far more common, and the 0 is smaller than every real value, so it wins every downstream comparison, ranking and conditional format. The standard guard is IF(COUNTIFS(<same criteria>)=0, "none", MINIFS(...)), and it is worth writing every time the data are strictly positive.

  • Non-numeric cells at selected positions. Whether they are skipped or fatal is not stated on Microsoft's page for this function, and the Handbook has not checked.
  • Shape mismatch → #VALUE!, documented.
  • Whole-column ranges match in shape and are the common idiom.
  • Criteria referring to an empty cell are treated as 0, documented.

Errors

Microsoft's page documents exactly one error condition. There is no documented #NUM!, no #N/A, and no error for the no-match case — that answer is 0.

How to implement

Numerical notes

The reduction half has no arithmetic and no rounding error, exactly as MIN does not. The numerical substance is entirely in the selection half.

The comparison predicate is the whole story. A numeric criterion must decide whether a stored double equals, exceeds or falls below a target. Three predicates are plausible and they disagree on real data:

  1. Raw IEEE comparison — 0.1+0.2 = 0.3 is FALSE and the cell is excluded.
  2. Truncation to 15 significant decimal digits before comparing — the behaviour the upstream defect stream BUG-FUNC-004 records for Excel's tolerant comparison families. Under this rule the two are equal and the cell is included.
  3. A relative-epsilon comparison — plausible-looking, and not what the record describes.

The difference is not a last-bit matter. It changes which cells are in the population, and therefore can change the returned minimum by an arbitrary amount — including changing it from a real value to the no-match 0, which is the worst outcome available. A criterion ">=0.3" applied to a column containing 0.1+0.2 either admits a row or does not, and if that row held the only match, the answer flips from a number to a zero that looks like data.

The text round trip. Criteria strings are parsed, so a criterion built by concatenation — ">="&A1 — passes the threshold through number-to-text-to-number. Excel's general number formatting renders at most 15 significant digits, so a threshold needing the 16th or 17th digit cannot survive. The criteria language offers no typed alternative; a helper column of booleans does.

The empty-set convention. As on MIN, the documented no-match answer is 0, which is a lower bound for most real data rather than an upper one. Chained or hierarchical MINIFS computations inherit the associativity trap described on the MIN page in its sharpest form: a top-level minimum of 0 over strictly positive data almost always means an empty selection somewhere below, and almost never means what it appears to mean.

Rust code

Show the CalcFunc source of this function

Quoted from the public repository DnaCalc/DnaCalc, crates calc-func and calc-fml, at commit 9e1884369a67. Comments are the source's own. A kernel shared with other functions appears once, on its module page.

MINIFS · 1 lines · calc-func/src/catalogue/conditional.rs on GitHub
conditional(MINIFS, "MINIFS", (3, 255), MIN_PAIRS, minifs)
minifs · 11 lines · calc-func/src/catalogue/conditional.rs on GitHub
/// MINIFS: the smallest matched number, or 0 when there is none.
fn minifs(
    arguments: &[CalcValue],
    services: &mut EvalServices<'_>,
) -> Result<CalcValue, FunctionFault> {
    let site = Site::new(MINIFS, services);
    Site::finish(
        pairs(&site, arguments, services, true)
            .and_then(|plan| extreme(&site, &plan, services, |n, best| n < best)),
    )
}

Kernels shared with other functions

Argument and result plumbing

No implementation has been published with a Handbook test suite for this function.

Version differences

No comparison between specific Excel builds is recorded here yet. This does not establish that all builds behave alike.

Alternatives

Relationships

  • MIN — the unconditional minimum. The two differ in more than the filter: MIN takes a variadic value list and applies the direct-versus-scan coercion split, while MINIFS takes ranges only and applies the criteria family's comparison rules.
  • SUMIFS, AVERAGEIFS, COUNTIFS — the rest of the multi-criteria family, sharing the selection stage. COUNTIFS on the same criteria is the standard way to tell "no match" from "the minimum is zero".
  • SUMIF, AVERAGEIF, COUNTIF — the single-criterion ancestors, with the opposite argument order: criteria range first, result range last, where the …IFS functions put the result range first. Converting between them is the most common silent editing mistake in the family.
  • DMIN — the database-family conditional minimum, using a headed criteria range instead of range/criterion pairs. DMIN can express OR; MINIFS cannot.
  • MIN(IF(…)) — the legacy array-formula idiom, which uses ordinary worksheet equality rather than the criteria language and therefore does not always agree with MINIFS.
  • FILTER with MIN — the modern dynamic-array route, which supports OR and arbitrary boolean expressions and uses ordinary comparison operators.

Named variants

No named variants are recorded yet.

Suggest a correction or contribute an implementation · For agents