Statistical functions
AVERAGEIFS
Matches all 13 recorded answers
Recorded: 13 workbook cells. How we measure this · See the Rust code
Local names in 40 languages
| Language | Name in Excel |
|---|---|
| Arabic | AVERAGEIFS |
| Bulgarian | AVERAGEIFS |
| Czech | AVERAGEIFS |
| Danish | MIDDEL.HVISER |
| German | AVERAGEIFS |
| Greek | AVERAGEIFS |
| English (Australia) | AVERAGEIFS |
| English (United Kingdom) | AVERAGEIFS |
| English (United States) | AVERAGEIFS |
| Spanish | PROMEDIO.SI.CONJUNTO |
| Estonian | AVERAGEIFS |
| Finnish | KESKIARVO.JOS.JOUKKO |
| French | MOYENNE.SI.ENS |
| Hebrew | AVERAGEIFS |
| Croatian | AVERAGEIFS |
| Hungarian | ÁTLAGHATÖBB |
| Indonesian | AVERAGEIFS |
| Italian | AVERAGEIFS |
| Japanese | AVERAGEIFS |
| Korean | AVERAGEIFS |
| Lithuanian | AVERAGEIFS |
| Latvian | AVERAGEIFS |
| Norwegian | GJENNOMSNITTHVIS |
| Dutch | AVERAGEIFS |
| Polish | ŚREDNIA.WARUNKÓW |
| Portuguese (Brazil) | MÉDIASES |
| Portuguese (Portugal) | MÉDIA.SE.S |
| Romanian | AVERAGEIFS |
| Russian | СРЗНАЧЕСЛИМН |
| Slovak | AVERAGEIFS |
| Slovenian | AVERAGEIFS |
| Serbian (Latin) | AVERAGEIFS |
| Swedish | MEDEL.OMF |
| Thai | AVERAGEIFS |
| Turkish | ÇOKEĞERORTALAMA işlevi |
| Ukrainian | AVERAGEIFS |
| Vietnamese | AVERAGEIFS |
| Chinese (Simplified) | AVERAGEIFS |
| Chinese (Hong Kong) | AVERAGEIFS |
| Chinese (Traditional) | AVERAGEIFS |
Names from Microsoft's support site.
What it does
AVERAGEIFS(average_range, criteria_range1, criteria1, [criteria_range2], [criteria2], ...)
AVERAGEIFS(average_range, criteria_range1, criteria1, [criteria_range2, criteria2], …)
averages the numeric cells of average_range at the positions where every criterion holds:
M = { i : criteria₁(criteria_range₁[i]) ∧ … ∧ criteria_m(criteria_range_m[i]) }
result = ( Σ_{i ∈ M, average_range[i] numeric} average_range[i] )
/ #{ i ∈ M : average_range[i] numeric }
The conjunction is positional, not relational: position (i) in every criteria range refers to
the same row of the same conceptual table as position (i) in average_range. This is why the
shapes must agree, and it is why AVERAGEIFS cannot express a join.
Microsoft states the rule in one sentence: "Each cell in average_range is used in the average calculation only if all of the corresponding criteria specified are true for that cell."
There is no OR form. Disjunction has to be built as a sum of AVERAGEIFS results — which is
wrong for a mean, because means do not add — or by moving to FILTER or SUMPRODUCT. That
asymmetry (AND is a function, OR is not) is a real limitation of the whole …IFS family.
The criteria parsing and cell-matching stages are shared verbatim with
AVERAGEIF, COUNTIF(S), SUMIF(S), MAXIFS and
MINIFS; that section is the single description, and it is not repeated here.
Arguments
| Argument | Meaning | Default |
|---|---|---|
average_range | The cells actually averaged. Required, and first. | — |
criteria_range1 | The first range tested. Required. | — |
criteria1 | The first criterion. Required. | — |
criteria_range2, criteria2 … | Further range/criterion pairs. Optional, in pairs. | — |
The argument order is reversed relative to AVERAGEIF. In AVERAGEIF the tested range comes
first and the averaged range is an optional third argument; in AVERAGEIFS the averaged range
comes first and is mandatory. Rewriting one as the other by adding a criterion pair silently
produces a different formula.
Try it
Quirks
Differences from AVERAGEIF that are not just "more criteria"
AVERAGEIF | AVERAGEIFS | |
|---|---|---|
| Averaged range | third argument, optional | first argument, required |
| Shape rule | anchored: only the top-left of average_range matters | exact: every range must be the same size and shape |
| Criteria count | exactly one | one or more, conjoined |
| Argument structure | fixed 2–3 | first argument plus range/criterion pairs |
| Documented logical rule | TRUE/FALSE cells are ignored | TRUE evaluates as 1, FALSE as 0 |
The documented logical rule is the row where the two Microsoft pages contradict each other; see the divergences section.
Result and edge cases
Returns Number.
- No position satisfies every criterion →
#DIV/0!, documented: "If there are no cells that meet all the criteria, AVERAGEIFS returns the #DIV/0! error value." - A single criterion pair.
AVERAGEIFS(B1:B10, A1:A10, ">5")is the exact-shape analogue ofAVERAGEIF(A1:A10, ">5", B1:B10), and is the safer of the two to write precisely because no anchoring can occur. - Empty cells in
average_rangecontribute to neither sum nor count. - Overlapping ranges, including using
average_rangeas its own criteria range, are ordinary. - Arrays. The surface lifts natively (
lift_broadcast_profile: surface_native); inline array arguments are accepted but must match shape exactly, since an array carries no reference to re-anchor.
Documentation divergences
- The
#DIV0!spelling appears in the remark text on both pages where#DIV/0!is meant; noted so a reader searching for the code finds the remark.
How to implement
Numerical notes
The reduction is the same plain sequential f64 accumulation and single division as
AVERAGE, applied to the masked subset in row-major order.
Its error analysis carries over unchanged: a bound proportional to (\sum|x_i|) over the
selected cells, and order sensitivity.
Two things are specific to this surface.
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.
AVERAGEIFS · 7 lines · calc-func/src/catalogue/conditional.rs on GitHubconditional(
AVERAGEIFS,
"AVERAGEIFS",
(3, 255),
AVERAGE_PAIRS,
averageifs,
)
averageifs · 10 lines · calc-func/src/catalogue/conditional.rs on GitHub/// AVERAGEIFS: AVERAGEIF over the rows that meet every criterion.
fn averageifs(
arguments: &[CalcValue],
services: &mut EvalServices<'_>,
) -> Result<CalcValue, FunctionFault> {
let site = Site::new(AVERAGEIFS, services);
Site::finish(
pairs(&site, arguments, services, true).and_then(|plan| mean(&site, &plan, services)),
)
}
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/conditionaltotalcatalogue/conditionalmeancatalogue/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
- AVERAGEIF — the singular form, with reversed argument order and the anchoring rule this function drops. The shared criteria language is documented there.
SUMIFS/COUNTIFS/MAXIFS/MINIFS— the rest of the plural family, same module, same conjunction, same shape rule.AVERAGEIFSisSUMIFS/COUNTIFSonly when every matched cell is numeric; when a matched cell holds text the divisors differ, becauseCOUNTIFScounts matched positions andAVERAGEIFScounts matched numeric cells.DAVERAGE— the database-family conditional mean. It expresses OR natively, through multiple criteria rows, which is exactly whatAVERAGEIFScannot do; see DAVERAGE.FILTER+AVERAGE, orAVERAGE(IF(...))as an array formula — the routes that can express disjunction and relational conditions. They use ordinary worksheet comparison, so they do not inherit the wildcard language or the tolerant numeric comparison.GROUPBY/PIVOTBY— where a whole table of conditional means is wanted rather than one cell.
Named variants
No named variants are recorded yet.
Suggest a correction or contribute an implementation · For agents