{
  "category": "Statistical functions",
  "display_name": "MINIFS",
  "entry_kind": "built_in_function",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.MINIFS",
  "implementation_state": {
    "answer_bank": null,
    "detail": "Recorded: 13 workbook cells.",
    "dnacalc_commit": "9e1884369a678158dd82d3d74188daf986995e87",
    "in_catalogue": true,
    "state": "matches",
    "state_label": "Matches every recorded Excel answer",
    "summary": "Matches all 13 recorded answers",
    "workbook_corpus": {
      "cells": 13,
      "matched": 13
    }
  },
  "implementations": [
    {
      "commit": "9e1884369a678158dd82d3d74188daf986995e87",
      "flavour": "excel-compatibility-candidate",
      "language": "Rust",
      "name": "CalcFunc",
      "own_code": [
        "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/conditional.rs#L178-L178",
        "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/conditional.rs#L264-L274"
      ],
      "repository": "https://github.com/DnaCalc/DnaCalc",
      "shared_code": [
        "catalogue/aggregate::reader",
        "catalogue/aggregate::read_reference",
        "catalogue/comparison::numbers",
        "catalogue/comparison::in_band",
        "catalogue/comparison::Rounded::up",
        "catalogue/comparison::Roundings::of",
        "catalogue/comparison::Roundings::disjoint",
        "catalogue/comparison::texts",
        "catalogue/comparison/collation::compare",
        "catalogue/comparison/collation::weighed",
        "catalogue/comparison/collation::measured_iteration_extension",
        "catalogue/comparison/sort_key::table",
        "catalogue/comparison/sort_key::decode64",
        "catalogue/comparison/sort_key::Reader::byte",
        "catalogue/comparison/sort_key::Reader::varint",
        "catalogue/comparison/sort_key::Reader::done",
        "catalogue/comparison/sort_key::in_ranges",
        "catalogue/comparison/sort_key::build",
        "catalogue/comparison/sort_key::han_base",
        "catalogue/comparison/sort_key::derive",
        "catalogue/comparison/sort_key::shared_jamo_tails",
        "catalogue/comparison/sort_key::ordinary_jamo_prefix",
        "catalogue/comparison/sort_key::independent_jamo_suffix",
        "catalogue/comparison/sort_key::jamo_leading_primary",
        "catalogue/comparison/sort_key::leading_order",
        "catalogue/comparison/sort_key::Before::separate_special",
        "catalogue/comparison/sort_key::Gathered::kana",
        "catalogue/comparison/sort_key::Gathered::unit",
        "catalogue/comparison/sort_key::parts",
        "catalogue/comparison/sort_key::diacritic_order",
        "catalogue/comparison/sort_key::diacritics",
        "catalogue/conditional::conditional",
        "catalogue/conditional::extreme",
        "catalogue/conditional::Range::shape",
        "catalogue/conditional::range",
        "catalogue/conditional::pairs",
        "catalogue/conditional::Plan::each_matched",
        "catalogue/conditional::row",
        "catalogue/conditional::offset",
        "catalogue/conditional::read_range",
        "catalogue/conditional::verdicts",
        "catalogue/conditional::target_cells",
        "catalogue/conditional::used",
        "catalogue/conditional::Match::of",
        "catalogue/conditional::Match::negated",
        "catalogue/conditional::Op::holds",
        "catalogue/conditional::Op::is_equality",
        "catalogue/conditional::spells",
        "catalogue/conditional::criterion",
        "catalogue/conditional::rank",
        "catalogue/conditional::criterion_text",
        "catalogue/conditional::decided",
        "catalogue/conditional::Criterion::verdict",
        "catalogue/conditional::equality",
        "catalogue/conditional::is_surrogate",
        "catalogue/conditional::wildcard",
        "decimal::low32",
        "decimal::Natural::from_u64",
        "decimal::Natural::pow10",
        "decimal::Natural::normalize",
        "decimal::Natural::is_zero",
        "decimal::Natural::mul_add_small",
        "decimal::Natural::times_pow10",
        "decimal::Natural::times_pow5",
        "decimal::Natural::times_pow2",
        "decimal::ExactDecimal::binary",
        "ported/text_kernels::text",
        "ported/text_kernels::text_from_str",
        "ported/text_kernels::fold_unit",
        "ported/text_kernels::push_singleton_or_original",
        "ported/text_kernels::push_lower",
        "ported/text_kernels::lower"
      ],
      "source": "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/conditional.rs#L178-L178",
      "state": "matches",
      "suite": null,
      "summary": "Matches all 13 recorded answers"
    }
  ],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.MINIFS.json",
  "name": "MINIFS",
  "notes": [],
  "schema": "efh.function-reference/v1",
  "section_order": [
    "what-it-does",
    "try-it",
    "quirks",
    "how-to-implement",
    "version-differences",
    "alternatives"
  ],
  "sections": {
    "alternatives": "\n### Relationships\n\n- **[MIN](FUNC.MIN.md)** — the unconditional minimum. The two differ in more than the filter:\n  `MIN` takes a variadic value list and applies the direct-versus-scan coercion split, while\n  `MINIFS` takes ranges only and applies the criteria family's comparison rules.\n- **`SUMIFS`**, **[AVERAGEIFS](FUNC.AVERAGEIFS.md)**,\n  **`COUNTIFS`** — the rest of the multi-criteria family, sharing the\n  selection stage. `COUNTIFS` on the same criteria is the standard way to tell \"no match\" from\n  \"the minimum is zero\".\n- **[SUMIF](FUNC.SUMIF.md)**, **[AVERAGEIF](FUNC.AVERAGEIF.md)**, **`COUNTIF`**\n  — the single-criterion ancestors, with the *opposite* argument order: criteria range first,\n  result range last, where the `…IFS` functions put the result range first. Converting between\n  them is the most common silent editing mistake in the family.\n- **[DMIN](FUNC.DMIN.md)** — the database-family conditional minimum, using a headed criteria\n  range instead of range/criterion pairs. `DMIN` can express OR; `MINIFS` cannot.\n- **`MIN(IF(…))`** — the legacy array-formula idiom, which uses ordinary worksheet equality\n  rather than the criteria language and therefore does not always agree with `MINIFS`.\n- **[FILTER](FUNC.FILTER.md)** with `MIN` — the modern dynamic-array route, which supports OR\n  and arbitrary boolean expressions and uses ordinary comparison operators.\n\n\n",
    "how-to-implement": "\n### Numerical notes\n\n\nThe reduction half has no arithmetic and no rounding error, exactly as [MIN](FUNC.MIN.md) does\nnot. The numerical substance is entirely in the **selection** half.\n\n**The comparison predicate is the whole story.** A numeric criterion must decide whether a\nstored double equals, exceeds or falls below a target. Three predicates are plausible and they\ndisagree on real data:\n\n1. **Raw IEEE comparison** — `0.1+0.2 = 0.3` is FALSE and the cell is excluded.\n2. **Truncation to 15 significant decimal digits before comparing** — the behaviour the upstream\n   defect stream `BUG-FUNC-004` records for Excel's tolerant comparison families. Under this\n   rule the two are equal and the cell is included.\n3. **A relative-epsilon comparison** — plausible-looking, and not what the record describes.\n\nThe difference is not a last-bit matter. It changes **which cells are in the population**, and\ntherefore can change the returned minimum by an arbitrary amount — including changing it from a\nreal value to the no-match `0`, which is the worst outcome available. A criterion `\">=0.3\"`\napplied to a column containing `0.1+0.2` either admits a row or does not, and if that row held\nthe only match, the answer flips from a number to a zero that looks like data.\n\n**The text round trip.** Criteria strings are parsed, so a criterion built by concatenation —\n`\">=\"&A1` — passes the threshold through number-to-text-to-number. Excel's general number\nformatting renders at most 15 significant digits, so a threshold needing the 16th or 17th digit\ncannot survive. The criteria language offers no typed alternative; a helper column of booleans\ndoes.\n\n**The empty-set convention.** As on `MIN`, the documented no-match answer is `0`, which is a\n*lower* bound for most real data rather than an upper one. Chained or hierarchical `MINIFS`\ncomputations inherit the associativity trap described on the [MIN](FUNC.MIN.md) page in its\nsharpest form: a top-level minimum of `0` over strictly positive data almost always means an\nempty selection somewhere below, and almost never means what it appears to mean.\n\n\n",
    "quirks": "\n### The criteria language\n\n\nThe criteria argument is the family's shared mini-language, and Microsoft's page says the\nmatching works consistently with `MAXIFS`, `SUMIFS` and `AVERAGEIFS`. The parts that bear on\n`MINIFS` specifically:\n\n- A bare number or text is an equality test.\n- A text criterion may begin with a comparison operator — `\">5\"`, `\"<>x\"`, `\"<=\"&A1` — which is\n  parsed out of the string.\n- Wildcards `?` and `*` apply to text criteria, with `~` as the escape.\n- **An empty criteria cell is treated as zero**, documented. `MINIFS(B:B, A:A, C1)` with `C1`\n  blank does not mean \"no filter\"; it means \"equal to zero\".\n\n\n### Result and edge cases\n\n\nReturns `Number`.\n\n  **This convention is more dangerous on `MINIFS` than on [MAXIFS](FUNC.MAXIFS.md), for the\n  same reason it is more dangerous on `MIN` than on `MAX`.** Most spreadsheet data is positive.\n  A `MINIFS` of `0` over positive data means either \"nothing matched\" or \"the smallest matching\n  value is zero\", and the two are indistinguishable — but the first is far more common, and the\n  `0` is *smaller than every real value*, so it wins every downstream comparison, ranking and\n  conditional format. The standard guard is\n  `IF(COUNTIFS(<same criteria>)=0, \"none\", MINIFS(...))`, and it is worth writing every time\n  the data are strictly positive.\n\n- **Non-numeric cells at selected positions.** Whether they are skipped or fatal is not stated\n  on Microsoft's page for this function, and the Handbook has not checked.\n- **Shape mismatch** → `#VALUE!`, documented.\n- **Whole-column ranges** match in shape and are the common idiom.\n- **Criteria referring to an empty cell** are treated as `0`, documented.\n\n\n\n### Errors\n\nMicrosoft's page documents exactly one error condition. There is no documented `#NUM!`, no\n`#N/A`, and no error for the no-match case — that answer is `0`.\n\n\n",
    "sources": "- Handbook [MAXIFS](FUNC.MAXIFS.md) — the mirror surface, with the same criteria language and\n  the same findings.\n- Handbook [MIN](FUNC.MIN.md) — the unconditional reduction, the empty-set convention and its\n  directional hazard.\n- Handbook [Coercion and lifting](../model/02-coercion-and-lifting.md) — the family-policy\n  treatment of comparison and scanning.\n- Handbook projections `data/functions/FUNC.MINIFS.json` (arity 3–255, **no `xlcall` entry**,\n  `RefsVisibleInAdapter`, `ReductionFold`, `SequentialLeftFold`) and\n  `data/presence/FUNC.MINIFS.json` (module `criteria_family.rs`, shared with `AVERAGEIF`,\n  `AVERAGEIFS`, `COUNTIF`, `COUNTIFS`, `MAXIFS`, `SUMIF`, `SUMIFS`).\n\n",
    "version-differences": "No comparison between specific Excel builds is recorded here yet. This does not establish that all builds behave alike.",
    "what-it-does": "\n`MINIFS(min_range, criteria_range1, criteria1, [criteria_range2, criteria2], …)` returns the\nsmallest value among the cells of `min_range` whose correspondingly-positioned cells in every\ncriteria range satisfy the matching criterion.\n\nWith `i` ranging over positions in the common shape:\n\n    S = { i : P₁(criteria_range1[i]) ∧ … ∧ P_k(criteria_range_k[i]) }\n    MINIFS = min { min_range[i] : i ∈ S, min_range[i] is numeric }\n\nTwo structural facts:\n\n1. **Criteria pairs combine with AND, positionally.** There is no OR form inside a single call.\n   The link between a criteria cell and a `min_range` cell is position, which is why the shapes\n   must agree. Microsoft's page adds a clarification worth quoting: the ranges \"don't need to be\n   aligned, only the same shape/size\" — they may sit anywhere on the sheet, and correspondence\n   is by offset within each range, not by row number.\n2. **`MINIFS` is a selection stage followed by a reduction.** The selection is shared with the\n   whole criteria family and carries a comparison-predicate question; the reduction is shared\n   with [MIN](FUNC.MIN.md) and carries the empty-set question. The two halves fail differently\n   and are worth separating.\n\n**Domain and result.** `min_range` may hold anything; only its numeric cells participate. When\n`S` is empty, Microsoft documents that the function returns `0`.\n\n\n\n### Arguments\n\n\n| Argument | Meaning | Required |\n|---|---|---|\n| `min_range` | \"The actual range of cells in which the minimum value will be determined.\" | Yes |\n| `criteria_range1` | \"Is the set of cells to evaluate with the criteria.\" | Yes |\n| `criteria1` | \"Is the criteria in the form of a number, expression, or text that defines which cells will be evaluated as minimum.\" | Yes |\n| `criteria_range2, criteria2, …` | Additional range/criteria pairs; up to 126 pairs | No |\n\n**Shape, not count.** A `3×1` `min_range` against a `1×3` criteria range is a mismatch even\nthough both hold three cells. Microsoft documents `#VALUE!` for that case.\n\n"
  },
  "signature": {
    "display": "MINIFS(min_range, criteria_range1, criteria1, [criteria_range2], [criteria2], ...)",
    "parameters": [
      {
        "description": null,
        "name": "min_range",
        "optional": false,
        "repeats": false
      },
      {
        "description": null,
        "name": "criteria_range1",
        "optional": false,
        "repeats": false
      },
      {
        "description": null,
        "name": "criteria1",
        "optional": false,
        "repeats": false
      },
      {
        "description": null,
        "name": "criteria_range2",
        "optional": true,
        "repeats": false
      },
      {
        "description": null,
        "name": "criteria2",
        "optional": true,
        "repeats": true
      }
    ],
    "trailing_repeats": true
  },
  "sources": {
    "metadata": {
      "admission": {
        "label": "implemented",
        "reason": null
      },
      "arity": {
        "max": 255,
        "min": 3
      },
      "category": "Statistical functions",
      "classification": {
        "arg_preparation_profile": "RefsVisibleInAdapter",
        "coercion_lift_profile": "Custom",
        "determinism_class": "Deterministic",
        "error_collapse_profile": "ReductionFold",
        "fec_dependency_profile": "RefOnly",
        "host_interaction_class": "None",
        "kernel_signature_class": "Custom",
        "rich_value_usage": "RichBlind",
        "surface_fec_dependency_profile": "RefOnly",
        "thread_safety_class": "SafePure",
        "volatility_class": "NonVolatile"
      },
      "descriptions": {
        "long": null,
        "short": "Smallest value among the cells that meet every condition",
        "short_source": "dna-calc-own"
      },
      "docs": {
        "english_description": "Returns the minimum value among cells specified by a given set of conditions or criteria.",
        "microsoft_url": "https://support.microsoft.com/en-us/office/minifs-function-6ca1ddaa-079b-4e74-80cc-72eef32e6599"
      },
      "entry_kind": "built_in_function",
      "localized_family_names": null,
      "localized_names": [
        {
          "locale": "ar-SA",
          "name": "MINIFS"
        },
        {
          "locale": "bg-BG",
          "name": "MINIFS"
        },
        {
          "locale": "cs-CZ",
          "name": "MINIFS"
        },
        {
          "locale": "da-DK",
          "name": "MINHVISER"
        },
        {
          "locale": "de-DE",
          "name": "MINIFS"
        },
        {
          "locale": "el-GR",
          "name": "MINIFS"
        },
        {
          "locale": "en-AU",
          "name": "MINIFS"
        },
        {
          "locale": "en-GB",
          "name": "MINIFS"
        },
        {
          "locale": "en-US",
          "name": "MINIFS"
        },
        {
          "locale": "es-ES",
          "name": "MIN.SI.CONJUNTO"
        },
        {
          "locale": "et-EE",
          "name": "MINIFS"
        },
        {
          "locale": "fi-FI",
          "name": "MIN.JOS.JOUKKO"
        },
        {
          "locale": "fr-FR",
          "name": "MIN.SI.ENS*"
        },
        {
          "locale": "he-IL",
          "name": "MINIFS"
        },
        {
          "locale": "hr-HR",
          "name": "MINIFS"
        },
        {
          "locale": "hu-HU",
          "name": "MINHA"
        },
        {
          "locale": "id-ID",
          "name": "MINIFS"
        },
        {
          "locale": "it-IT",
          "name": "MINIFS"
        },
        {
          "locale": "ja-JP",
          "name": "MINIFS"
        },
        {
          "locale": "ko-KR",
          "name": "MINIFS"
        },
        {
          "locale": "lt-LT",
          "name": "MINIFS"
        },
        {
          "locale": "lv-LV",
          "name": "MINIFS"
        },
        {
          "locale": "nb-NO",
          "name": "MINIFS"
        },
        {
          "locale": "nl-NL",
          "name": "MIN.ALS.VOORWAARDEN"
        },
        {
          "locale": "pl-PL",
          "name": "MIN.WARUNKÓW"
        },
        {
          "locale": "pt-BR",
          "name": "MINIFS"
        },
        {
          "locale": "pt-PT",
          "name": "MÍNIMO.SE.S"
        },
        {
          "locale": "ro-RO",
          "name": "MINIFS"
        },
        {
          "locale": "ru-RU",
          "name": "МИНЕСЛИ"
        },
        {
          "locale": "sk-SK",
          "name": "MINIFS"
        },
        {
          "locale": "sl-SI",
          "name": "MINIFS"
        },
        {
          "locale": "sr-Latn-RS",
          "name": "MINIFS"
        },
        {
          "locale": "sv-SE",
          "name": "MINIFS"
        },
        {
          "locale": "th-TH",
          "name": "MINIFS"
        },
        {
          "locale": "tr-TR",
          "name": "ÇOKEĞERMİN"
        },
        {
          "locale": "uk-UA",
          "name": "MINIFS"
        },
        {
          "locale": "vi-VN",
          "name": "MINIFS"
        },
        {
          "locale": "zh-CN",
          "name": "MINIFS"
        },
        {
          "locale": "zh-HK",
          "name": "MINIFS"
        },
        {
          "locale": "zh-TW",
          "name": "MINIFS"
        }
      ],
      "signature": {
        "display": "MINIFS(min_range, criteria_range1, criteria1, [criteria_range2], [criteria2], ...)",
        "parameters": [
          {
            "description": null,
            "name": "min_range",
            "optional": false,
            "repeats": false
          },
          {
            "description": null,
            "name": "criteria_range1",
            "optional": false,
            "repeats": false
          },
          {
            "description": null,
            "name": "criteria1",
            "optional": false,
            "repeats": false
          },
          {
            "description": null,
            "name": "criteria_range2",
            "optional": true,
            "repeats": false
          },
          {
            "description": null,
            "name": "criteria2",
            "optional": true,
            "repeats": true
          }
        ],
        "trailing_repeats": true
      },
      "surface_name": "MINIFS",
      "version_marker": null,
      "xlcall": null
    },
    "microsoft": "https://support.microsoft.com/en-us/office/minifs-function-6ca1ddaa-079b-4e74-80cc-72eef32e6599"
  },
  "try_it": {
    "formula": "=MINIFS(C2:C4,B2:B4,\">1\")",
    "inputs": {
      "B2": 1,
      "B3": 2,
      "B4": 3,
      "C2": 10,
      "C3": 20,
      "C4": 30
    }
  },
  "url": "https://handbook.dnacalc.com/functions/MINIFS.html",
  "variants": [],
  "versions": []
}