B Function (LibreOffice Calc)
LibreOffice B calculates binomial probabilities for one count or an inclusive success range. Learn its actual argument order, examples and boundaries.
Verification status: LibreOffice 26.8.1.1 source identity and independently calculated binomial examples were reviewed. No new native execution is claimed for this article revision. How formula examples are checked
Availability and version history
- Introduced: Documented by LibreOffice 26.8.1.1; original introduction not established.
- Availability: Supported in LibreOffice 26.8.1.1, verified against its function registry. This identifies a supported release, not a final working version.
- Scope: Desktop Calc, using the English function name. Availability in other spreadsheet applications is separate.
- Checked: 2026-10-14 — function reference; versioned support. Documentation/source check; not a new native test. Existing example-specific test claims below retain their stated scope.
B calculates binomial probabilities in LibreOffice Calc. It is not Euler’s beta function. =B(10;0.5;3;5) returns the probability of three through five successes in ten trials, with independent reference value 0.568359375.
Meaning and argument order
B returns a probability for a binomial count model. With three arguments it gives the mass at one success count. With four, it sums the masses over an inclusive range. The probability model assumes a fixed number of independent trials and a constant success probability. Official B Help.
=B(Trials; SuccessProbability; LowerCount [; UpperCount])
Three or four arguments are required. Trials is the total trial count. SuccessProbability must lie from 0 through 1. LowerCount is either the single requested count or the first included count. If supplied, UpperCount is the last included count. Both ends are included; the last argument is a count, not a cumulative TRUE/FALSE flag.
The pinned evaluator rounds Trials and both counts down before its checks. Supply deliberate integers satisfying 0≤LowerCount≤UpperCount≤Trials. When UpperCount is omitted, use 0≤LowerCount≤Trials. Equal lower and upper counts select one mass.
Reproducible examples
These are independently calculated references rounded to twelve decimal places. No new native LibreOffice execution is claimed for this article revision.
| Formula | Independent reference |
|---|---|
=B(10;0.5;3;5) |
0.568359375 |
=B(10;0.5;3) |
0.1171875 |
=B(10;0.5;0;10) |
1 |
=B(10;0.2;2;4) |
0.591396864 |
=B(10;1/6;2) |
0.290710049202 |
=B(0;0.2;0) |
1 |
=B(10;0;0;3) |
1 |
=B(10;1;8;10) |
1 |
Practical worksheet: an inclusive success range
Suppose ten independent inspections each have success probability 0.5. Put 10 in A2, 0.5 in B2, 3 in C2 and 5 in D2. =B(A2;B2;C2;D2) gives approximately 56.84% for three, four or five successes. A success is whatever event the model defines; do not silently switch from passes to defects without changing the probability.
An independent count of arrangements gives (120+210+252)/1024=0.568359375. Omitting D2 does not ask for “at most three”: =B(10;0.5;3) gives only the mass at three, 0.1171875. For zero through three successes, explicitly use =B(10;0.5;0;3).
Advanced checks and related formulas
The inclusive interval can also be computed as =BINOM.DIST(5;10;0.5;TRUE())-BINOM.DIST(2;10;0.5;TRUE()). The subtracted cumulative probability ends one count before the lower boundary. Subtracting the CDF at 3 would incorrectly remove the probability of exactly three successes.
When the lower boundary is zero, use the upper CDF alone rather than asking BINOM.DIST for a negative cutoff. A range spanning zero through all Trials has probability 1. The reference =B(10;0.2;2;4) is 0.591396864, illustrating that the success probability belongs in the second position, unlike BINOM.DIST’s argument order.
For ten fair die throws, the chance of exactly two sixes is =B(10;1/6;2), approximately 0.290710049202. The interpretation depends on independent throws and the assumed one-in-six chance, not merely on entering the formula correctly.
Boundaries and troubleshooting
Reversed count limits and counts outside the trial range are rejected by the source. They are not automatically clipped or treated as zero probability. Probability 0 puts all mass at zero successes; probability 1 puts all mass at Trials. Zero trials permits only the zero-success event.
Fractional counts are floored rather than interpolated. If the counts came from measurements or a faulty formula, silently applying that coercion can conceal an upstream problem. Preserve calculation errors and validate the inputs against the intended discrete event.
BINOM.DIST.RANGE is a supported OpenFormula storage spelling for the same Calc operation. The English worksheet name is B; storage grammar and displayed function names are separate. This does not make B a beta special function or guarantee that another program accepts the same formula text.
If you need Euler’s beta function
For positive a and b, a mathematical beta-function expression is =EXP(GAMMALN(a)+GAMMALN(b)-GAMMALN(a+b)). At a=2 and b=3 it gives 1/12. This is a composition of existing functions, independently justified by gamma identities; it is not B(2;3) and is not separately native-tested here. Use BETA.DIST for beta-distribution probabilities or densities with its own argument contract.
Related functions and evidence
- BINOM.DIST: mass and cumulative binomial probabilities
- COMBIN: arrangements for a binomial mass
- GAMMALN: positive-domain log-gamma calculations
- BETA.DIST: the different continuous beta distribution
- Versioned B implementation and OpenFormula name mapping
The source and independent examples establish this revision’s checking scope. Extreme parameters, other locales and cross-application execution were not validated by these ordinary calculations.