Statistical functions
MAXIFS
Matches all 18 recorded answers
Recorded: 18 workbook cells. How we measure this · See the Rust code
Local names in 40 languages
| Language | Name in Excel |
|---|---|
| Arabic | MAXIFS |
| Bulgarian | MAXIFS |
| Czech | MAXIFS |
| Danish | MAKSHVISER |
| German | MAXIFS |
| Greek | MAXIFS |
| English (Australia) | MAXIFS |
| English (United Kingdom) | MAXIFS |
| English (United States) | MAXIFS |
| Spanish | MAX.SI.CONJUNTO |
| Estonian | MAXIFS |
| Finnish | MAKS.JOS.JOUKKO |
| French | MAX.SI.ENS |
| Hebrew | MAXIFS |
| Croatian | MAXIFS |
| Hungarian | MAXHA |
| Indonesian | MAXIFS |
| Italian | MAXIFS |
| Japanese | MAXIFS |
| Korean | MAXIFS |
| Lithuanian | MAXIFS |
| Latvian | MAXIFS |
| Norwegian | MAXIFS |
| Dutch | MAX.ALS.VOORWAARDEN |
| Polish | MAKS.WARUNKÓW |
| Portuguese (Brazil) | MAXIFS |
| Portuguese (Portugal) | MÁXIMO.SE.S |
| Romanian | MAXIFS |
| Russian | МАКСЕСЛИ |
| Slovak | MAXIFS |
| Slovenian | MAXIFS |
| Serbian (Latin) | MAXIFS |
| Swedish | MAXIFS |
| Thai | MAXIFS |
| Turkish | ÇOKEĞERMAK |
| Ukrainian | MAXIFS |
| Vietnamese | MAXIFS |
| Chinese (Simplified) | MAXIFS |
| Chinese (Hong Kong) | MAXIFS |
| Chinese (Traditional) | MAXIFS |
Names from Microsoft's support site.
What it does
MAXIFS(max_range, criteria_range1, criteria1, [criteria_range2], [criteria2], ...)
MAXIFS(max_range, criteria_range1, criteria1, [criteria_range2, criteria2], …) returns the
largest value among the cells of max_range whose correspondingly-positioned cells in every
criteria range satisfy the matching criterion.
Written out, with i ranging over positions in the common shape:
S = { i : P₁(criteria_range1[i]) ∧ P₂(criteria_range2[i]) ∧ … ∧ P_k(criteria_range_k[i]) }
MAXIFS = max { max_range[i] : i ∈ S, max_range[i] is numeric }
Two structural facts:
- The conditions are combined with AND, positionally. Criteria pairs intersect; there is
no OR form and no way to write one inside a single call. Position, not value, is what links
a criteria cell to a
max_rangecell — which is why the shapes must match. MAXIFSis a selection stage followed by a reduction. Everything about the selection is shared with the rest of the criteria family; everything about the reduction is shared with MAX. The two halves are worth thinking about separately, because they carry different risks — the selection carries a comparison-tolerance question, the reduction carries the empty-set question.
Microsoft documents the size requirement directly: "The size and shape of the max_range and criteria_rangeN arguments must be the same, otherwise these functions return the #VALUE! error."
Domain and result. max_range may hold anything; only its numeric cells participate in the
maximum. The result is a real number. When S is empty — or when no cell of max_range at a
selected position is numeric — Microsoft documents that the function returns 0.
Arguments
| Argument | Meaning | Required |
|---|---|---|
max_range | "The actual range of cells in which the maximum 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 maximum." | Yes |
criteria_range2, criteria2, … | "Additional ranges and their associated criteria. You can enter up to 126 range/criteria pairs." | No |
Ranges must match in shape, not merely in count. A 3×1 max_range against a 1×3
criteria range is a shape mismatch even though both hold three cells.
Try it
Quirks
The criteria language
The criteria argument is the family's shared mini-language, and Microsoft's page says so
explicitly: the same criteria format works across MINIFS, SUMIFS and AVERAGEIFS. The
Handbook documents the language once, on the criteria-family pages; the parts that bear on
MAXIFS specifically are:
- A bare number or text is an equality test.
- A text criterion may begin with a comparison operator —
">5","<>x",">="&A1— and the operator is parsed out of the string. - Wildcards
?and*apply to text criteria, with~as the escape. - Microsoft documents that a criteria argument referring to an empty cell is treated as 0.
That is a sharp edge:
MAXIFS(B:B, A:A, C1)withC1blank does not mean "no filter", it means "equal to zero".
Result and edge cases
Returns Number.
- Non-numeric cells at selected positions are not part of a numeric maximum. Whether they are skipped or cause an error is not stated on Microsoft's page for this function, and the Handbook has not checked.
- Shape mismatch →
#VALUE!, documented. - Whole-column ranges (
A:AagainstB:B) match in shape and are the common idiom; performance is an engine matter the Handbook does not assert on. - Criteria referring to an empty cell are treated as
0, documented — see above.
Errors
Microsoft's page documents exactly one error condition. It does not document a #NUM!, a
#N/A, or an error for the no-match case — the no-match answer is 0.
How to implement
Numerical notes
The reduction half of MAXIFS has no arithmetic and no rounding error, exactly as
MAX does not. The numerical substance is entirely in the selection half, and
it is genuinely substantial.
The comparison predicate is the whole story. A numeric criterion has to decide whether a stored double equals, exceeds or falls below a target double. Three predicates are plausible and they disagree on real data:
- Raw IEEE comparison —
0.1+0.2 = 0.3is FALSE, and the cell is excluded. - Truncation to 15 significant decimal digits before comparing — the behaviour the
upstream defect stream
BUG-FUNC-004records for Excel's tolerant comparison families. Under this rule0.1+0.2and0.3are equal and the cell is included. - 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 maximum by an arbitrary amount. A criterion ">=0.3" applied
to a column containing 0.1+0.2 either admits a row or does not, and if that row holds the
largest value the two answers differ completely. This is the reason MAXIFS belongs on a
numerical-behaviour page at all.
A second-order point: because the criteria strings are parsed, a criterion built by
concatenation — ">="&A1 — goes through a number-to-text-to-number round trip. Excel's
general number formatting renders at most 15 significant digits, so a threshold that needs the
16th or 17th digit to be represented exactly cannot survive the round trip. The safe idiom
passes the comparison operator and the value separately where the function allows it, or uses
a helper column of booleans; the criteria language does not offer a typed alternative.
The empty-set convention. As on MAX, the documented answer for no match is 0, which is
inside the range of plausible data rather than below it. Chained or hierarchical MAXIFS
computations over all-negative data inherit the same associativity trap described on the
MAX page: the top-level answer can be 0 when every underlying value is
negative.
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.
MAXIFS · 1 lines · calc-func/src/catalogue/conditional.rs on GitHubconditional(MAXIFS, "MAXIFS", (3, 255), MAX_PAIRS, maxifs)
maxifs · 11 lines · calc-func/src/catalogue/conditional.rs on GitHub/// MAXIFS: the largest matched number, or 0 when there is none.
fn maxifs(
arguments: &[CalcValue],
services: &mut EvalServices<'_>,
) -> Result<CalcValue, FunctionFault> {
let site = Site::new(MAXIFS, services);
Site::finish(
pairs(&site, arguments, services, true)
.and_then(|plan| extreme(&site, &plan, services, |n, best| n > best)),
)
}
Kernels shared with other functions
readercatalogue/aggregateread_referencecatalogue/aggregatenumberscatalogue/comparisonin_bandcatalogue/comparisonRounded::upcatalogue/comparisonRoundings::ofcatalogue/comparisonRoundings::disjointcatalogue/comparisontextscatalogue/comparisoncomparecatalogue/comparison/collationweighedcatalogue/comparison/collationmeasured_iteration_extensioncatalogue/comparison/collationtablecatalogue/comparison/sort_keydecode64catalogue/comparison/sort_keyReader::bytecatalogue/comparison/sort_keyReader::varintcatalogue/comparison/sort_keyReader::donecatalogue/comparison/sort_keyin_rangescatalogue/comparison/sort_keybuildcatalogue/comparison/sort_keyhan_basecatalogue/comparison/sort_keyderivecatalogue/comparison/sort_keyshared_jamo_tailscatalogue/comparison/sort_keyordinary_jamo_prefixcatalogue/comparison/sort_keyindependent_jamo_suffixcatalogue/comparison/sort_keyjamo_leading_primarycatalogue/comparison/sort_keyleading_ordercatalogue/comparison/sort_keyBefore::separate_specialcatalogue/comparison/sort_keyGathered::kanacatalogue/comparison/sort_keyGathered::unitcatalogue/comparison/sort_keypartscatalogue/comparison/sort_keydiacritic_ordercatalogue/comparison/sort_keydiacriticscatalogue/comparison/sort_keyconditionalcatalogue/conditionalextremecatalogue/conditionalRange::shapecatalogue/conditionalrangecatalogue/conditionalpairscatalogue/conditionalPlan::each_matchedcatalogue/conditionalrowcatalogue/conditionaloffsetcatalogue/conditionalread_rangecatalogue/conditionalverdictscatalogue/conditionaltarget_cellscatalogue/conditionalusedcatalogue/conditionalMatch::ofcatalogue/conditionalMatch::negatedcatalogue/conditionalOp::holdscatalogue/conditionalOp::is_equalitycatalogue/conditionalspellscatalogue/conditionalcriterioncatalogue/conditionalrankcatalogue/conditionalcriterion_textcatalogue/conditionaldecidedcatalogue/conditionalCriterion::verdictcatalogue/conditionalequalitycatalogue/conditionalis_surrogatecatalogue/conditionalwildcardcatalogue/conditionallow32decimalNatural::from_u64decimalNatural::pow10decimalNatural::normalizedecimalNatural::is_zerodecimalNatural::mul_add_smalldecimalNatural::times_pow10decimalNatural::times_pow5decimalNatural::times_pow2decimalExactDecimal::binarydecimaltextported/text_kernelstext_from_strported/text_kernelsfold_unitported/text_kernelspush_singleton_or_originalported/text_kernelspush_lowerported/text_kernelslowerported/text_kernels
Argument and result plumbing
operandcoerce
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
- MAX — the unconditional maximum. The two differ in more than the filter:
MAXtakes a variadic value list and applies the direct-versus-scan coercion split, whileMAXIFStakes ranges only and applies the criteria family's comparison rules. They are not the same reduction wearing a filter. SUMIFS, AVERAGEIFS,COUNTIFS— the rest of the multi-criteria family, sharing the selection stage.COUNTIFSwith the same criteria is the standard way to distinguish "no match" from "the maximum is zero".- SUMIF, AVERAGEIF,
COUNTIF— the single-criterion ancestors, whose argument order differs (range first, then criterion, then the sum range last) from the…IFSorder (result range first). That reversal is the most common editing mistake when converting between them, and it is silent when the ranges happen to be the same shape. - DMAX — the database-family conditional maximum, using a criteria range
with headers instead of range/criterion pairs.
DMAXcan express OR, whichMAXIFScannot. MAX(IF(…))— the legacy array-formula idiom for the same job, which uses ordinary worksheet equality rather than the criteria language and therefore does not always agree withMAXIFS. Where they disagree, the criteria language's comparison rules are usually the reason.- FILTER with
MAX— the modern dynamic-array route, which does support OR and arbitrary boolean expressions, and which uses ordinary comparison operators rather than criteria strings.
Named variants
No named variants are recorded yet.
Suggest a correction or contribute an implementation · For agents