Excel 16.0 build 19929
Windows, bitness not recorded, CPU not recorded
144 captured inputs are indexed for this environment. Capture dates are not recorded. This is a reading count, not a comparison with another build.
Math and trigonometry functions
Matches all 40,995 recorded answers
Recorded: 40,991 in the answer bank and 4 workbook cells. How we measure this · See the Rust code
| Language | Name in Excel |
|---|---|
| Arabic | COMBINA |
| Bulgarian | COMBINA |
| Czech | COMBINA |
| Danish | KOMBINA |
| German | COMBINA |
| Greek | COMBINA |
| English (Australia) | COMBINA |
| English (United Kingdom) | COMBINA |
| English (United States) | COMBINA |
| Spanish | COMBINA |
| Estonian | COMBINA |
| Finnish | KOMBINAATIO |
| French | COMBINA |
| Hebrew | COMBINA |
| Croatian | COMBINA |
| Hungarian | KOMBINÁCIÓK.ISM |
| Indonesian | COMBINA |
| Italian | COMBINA |
| Japanese | COMBINA |
| Korean | COMBINA |
| Lithuanian | COMBINA |
| Latvian | COMBINA |
| Norwegian | COMBINA |
| Dutch | COMBIN.A |
| Polish | KOMBINACJE.A |
| Portuguese (Brazil) | COMBINA |
| Portuguese (Portugal) | COMBIN.R |
| Romanian | COMBINA |
| Russian | ЧИСЛКОМБА |
| Slovak | COMBINA |
| Slovenian | COMBINA |
| Serbian (Latin) | COMBINA |
| Swedish | KOMBINA |
| Thai | COMBINA |
| Turkish | KOMBİNASYONA |
| Ukrainian | COMBINA |
| Vietnamese | COMBINA |
| Chinese (Simplified) | COMBINA |
| Chinese (Hong Kong) | COMBINA |
| Chinese (Traditional) | COMBINA |
Names from Microsoft's support site.
COMBINA(number, number_chosen)
COMBINA(number, number_chosen) counts combinations with repetition: the number of ways to
choose k items from n types when the same type may be chosen more than once and order does
not matter. This is the multiset coefficient, written ((n choose k)) in Stanley's notation.
Microsoft's page prints the equation directly, with N for number and M for
number_chosen:
COMBINA(N, M) = (N + M - 1)! / ( M! (N - 1)! )
which is the same thing as the binomial coefficient
COMBINA(n, k) = C(n + k - 1, k) = C(n + k - 1, n - 1)
The identity is the stars and bars argument: a multiset of size k drawn from n types is
determined by where you place n - 1 dividers among k + n - 1 positions.
| Property | Statement |
|---|---|
| Domain (documented) | n ≥ 0, k ≥ 0, and n ≥ k |
| Range | positive integers |
| Reduction | COMBINA(n, k) = C(n+k-1, k) — a binomial coefficient, always |
| Boundary | COMBINA(n, 0) = 1; COMBINA(1, k) = 1; COMBINA(n, 1) = n |
| Generating function | 1/(1-x)^n = Σ_k COMBINA(n, k) x^k |
| Symmetry | none in (n, k); the underlying binomial's symmetry is k ↔ n-1 |
One documentation observation belongs here rather than buried below, because it is a genuine
divergence between the mathematics and the published constraint. The multiset coefficient is
defined for every n ≥ 1 and every k ≥ 0, with no requirement that n ≥ k — choosing five
scoops from three flavours is a perfectly ordinary question, and the answer is C(7, 5) = 21.
Microsoft's page nevertheless documents Number as having to be "greater than or equal to
Number_chosen", and documents #NUM! when an argument is outside its constraints. Either Excel
refuses a well-posed combinatorial question, or the documented constraint is stricter than the
implementation. The Handbook has not checked which, and it is the first probe listed below.
| Argument | Meaning | Constraint (as documented) |
|---|---|---|
number (N) | The number of item types available. Required. | ≥ 0, and ≥ number_chosen |
number_chosen (M) | The number of items chosen. Required. | ≥ 0 |
Microsoft states that non-integer values are truncated in both positions, and that a
non-numeric value in either position gives #VALUE!.
Returns Number, mathematically always a positive integer.
k = 0 — one way to choose nothing: the value is 1.n = 0 — the printed equation reads (M-1)!/(M!(-1)!), which is undefined for M > 0;
the documented constraint N ≥ M forces M = 0 there, and COMBINA(0, 0) is conventionally
(0, 0) is a documented-constraint boundary the Handbook
has not checked.COMBINA(n, k) is C(n+k-1, k), so it crosses the 2^53 exact-integer
threshold at modest arguments and overflows the double range not far beyond.EV-MATH-0017 turns
exactly this observation into a substrate identification (below).The real-result policy axis records arg_domain_guard=none; non_finite=allow for this surface,
which — as on COMBIN — sits uneasily beside a documented #NUM! domain condition. Recorded
here as a divergence, not resolved.
As documented on Microsoft's COMBINA page:
| Error | Condition |
|---|---|
#NUM! | The value of either argument is outside its documented constraints |
#VALUE! | Either argument is a non-numeric value |
Note that the documented #NUM! condition is stated indirectly — "outside of its constraints"
— so the exact trigger set is only as precise as the constraint list above it, and that list
includes the N ≥ M requirement this page flags as mathematically unnecessary.
The interesting fact about this surface is that its evaluation route has been identified, and identified by a single decisive witness rather than by a sweep.
The reasoning is worth stating because it is a model of how substrate identification works.
COMBINA(n, k) is always an integer. A product of integers, evaluated in binary64, can round —
but it can only land on a representable neighbour of the true value, and while the true value
is below 2^53 the exact integer is representable, so a product route hits it. EV-MATH-0017
records a live witness in which Excel returns a value just below an exact integer that a product
route would have reached exactly. A product cannot produce that. An exp(lnΓ) composition can:
the logarithm loses the integrality, and the final exponentiation lands on whichever neighbour
the rounding chain reaches. The record therefore identifies the substrate as exp(gammaln) and
reduces COMBINA to the log-gamma wall — meaning its residual error is not its own problem
to solve but GAMMALN's.
Two honest riders travel with that, both from the record itself: the reference implementation
does not implement the identified substrate — it ships a product kernel — and the formal
reduction to GAMMALN is a designed recipe that has not been executed.
What a careful implementation does when it wants the intended function rather than the observed bits:
C(n+k-1, k), then apply the symmetry reduction
k ← min(k, n-1). Never form the three factorials of the printed equation — (N+M-1)!
overflows at an argument sum of 171 while the answer may still be small.acc ← acc·(n-1+i)/i, whose every partial product is
itself a binomial coefficient and therefore an exact integer while it fits.2^53. This is achievable and is the property the
exp(lnΓ) route gives up.2^53, the log-gamma route becomes attractive for range reasons and immediately
inherits log-gamma's accuracy: an absolute error ε in lnΓ becomes a relative error of
about ε in the result, and lnΓ of a large argument is large, so a small relative error
in the logarithm is a much larger relative error in the answer. That amplification is the
wall the record names, and it is the standard reason (A&S chapter 6; Numerical Recipes
bico) that libraries which use exp(factln) document reduced accuracy for large binomials.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.
COMBINA · 3 lines · calc-func/src/catalogue/math.rs on GitHub35 combina "COMBINA" (2, 2) [V "number", V "number_chosen"] |s, a, sv| {
out(s, k::combina::combina_kernel(num_with_subnormal(s, a, 0)?, num_with_subnormal(s, a, 1)?))
}
combina_kernel · 42 lines · calc-func/src/ported/combina.rs on GitHubpub fn combina_kernel(n: f64, k: f64) -> Result<f64, WorksheetErrorCode> {
// Range.Value2 cannot inject NaN/infinity into the live worksheet probe,
// but the direct Rust kernel keeps that unobserved seam deterministic.
if !n.is_finite() || !k.is_finite() {
return Err(WorksheetErrorCode::Num);
}
// The current x64 reference treats binary64 subnormals as signed zero at
// this admission seam (DAZ). Truncation then precedes the asymmetric
// negative-choice guard.
let n = if n.is_subnormal() {
0.0_f64.copysign(n)
} else {
n
};
let k = if k.is_subnormal() {
0.0_f64.copysign(k)
} else {
k
};
let truncated_n = n.trunc();
let truncated_k = k.trunc();
// This zero/zero publication precedes the negative-choice guard. Thus
// values in (-1,0), including a negative raw choice, publish one when both
// arguments truncate to zero.
if truncated_n == 0.0 && truncated_k == 0.0 {
return Ok(1.0);
}
if truncated_n < 0.0 || k < 0.0 {
return Err(WorksheetErrorCode::Num);
}
let total = truncated_n + truncated_k - 1.0;
// W109 current-reference identification: COMBINA truncates its two
// arguments separately, then routes C(n+k-1,k) through the same cyclic
// stored-x87 publication graph as COMBIN. In particular, this is not the
// worksheet-visible composition COMBIN(n+k-1,k), whose addition would
// occur before COMBIN truncates fractional arguments.
combin_kernel(total, truncated_k)
}
combin_kernel ported/combinbinary_with ported/excel_numericexcel_x87_mul ported/excel_numericexcel_x87_div ported/excel_numericmul ported/excel_numeric/x87div ported/excel_numeric/x87trunc_nonnegative ported/factorial_commonnum_with_subnormal catalogue/kitout catalogue/kitNo implementation has been published with a Handbook test suite for this function.
The recorded environments below distinguish a reading from a same-input comparison. Counts describe captured inputs in each environment; overlapping captures and comparisons are not totals of unique worksheet calls.
| Excel 16.0 build | Platform and CPU | Captured inputs |
|---|---|---|
| 19929 | Windows, bitness not recorded, CPU not recorded | 144 |
| 20228 | Windows, 64-bit, CPU not recorded | 39,773 |
| 20430 | Windows, 64-bit, CPU not recorded | 1,242 |
Agreement on these compared inputs does not establish agreement on unmeasured inputs.
Recorded environments and comparison details.
Windows, bitness not recorded, CPU not recorded
144 captured inputs are indexed for this environment. Capture dates are not recorded. This is a reading count, not a comparison with another build.
Windows, 64-bit, CPU not recorded
39,773 captured inputs are indexed for this environment. Capture dates: 2026-08-09 to 2026-08-09. This is a reading count, not a comparison with another build.
Windows, 64-bit, CPU not recorded
1,242 captured inputs are indexed for this environment. Capture dates: 2026-09-29 to 2026-09-29. This is a reading count, not a comparison with another build.
COMBINA(n, k) = COMBIN(n+k-1, k) means the two surfaces must agree on the same integer when
their arguments are matched up. They have different identified substrates, so that identity
is a metamorphic test rather than a tautology.PERMUTATIONA — with-repetition and ordered: simply n^k. PERMUT is the ordered
without-repetition count. The four functions form the standard 2×2 of ordered/unordered
against with/without repetition.GAMMALN, GAMMALN.PRECISE, EXP — the identified substrate composition.
EV-MATH-0017 reduces this surface's remaining error to the log-gamma surface's, which is
why the two pages should be read together.NEGBINOM.DIST — the distribution whose mass function is exactly a multiset coefficient
times probabilities; the same evaluation problem appears there with a stability requirement.No named variants are recorded yet.
Suggest a correction or contribute an implementation · For agents