Contact

B Function (OpenOffice Calc)

Statistical Intermediate OpenOffice Calc

Calculate Apache OpenOffice B binomial count probabilities and inclusive ranges, with argument-order examples, endpoint rules and source-specific count checks.

Verification status: Eight reference formulas and 3 boundary cases were recalculated in Apache OpenOffice 4.1.16 on Linux x86-64, Build 9816, using generated native ODF-formula input and GUI hard recalculation. Other explanatory calculations are independent references. How formula examples are checked

Quick answer: =B(10;0.5;3) has reference value 0.1171875.

Availability and version history

  • Introduced: First release not established; documented by OpenOffice.org 3.3.
  • Supported in: Apache OpenOffice 4.1.16; this is a verified release, not a final supported version.
  • Scope: Desktop Calc, English function names and semicolon-separated formulas. Locale and file-format mappings may differ.
  • Checked: October 14, 2026. Eight reference formulas and the listed boundary cases were recalculated in 4.1.16 on Linux x86-64, Build 9816, using generated native ODF-formula input. Source and independent mathematics were also checked.

What B returns

B returns a binomial probability for one success count or an inclusive range of counts. It is not Euler’s beta function. The model assumes a fixed number of independent trials with one constant success probability. Release implementation.

Syntax and arguments

=B(Trials; Probability; LowerCount [; UpperCount])

Three or four arguments are required. Trials is the total count, Probability is the chance of success on each trial, and LowerCount is either the requested count or the first included count. Optional UpperCount is the last included count. It is not a cumulative TRUE/FALSE switch. Probability may range from 0 through 1; the source floors Trials and both counts before checking 0≤LowerCount≤UpperCount≤Trials.

Reproducible examples

These eight formulas were recalculated in the stated 4.1.16 build using generated native ODF-formula input. Saved numeric results agree with independent high-precision calculations; values below are rounded to twelve decimal places. The comparison concerns stored values, not a claim that every display format prints the same digits.

Formula Reference / native agreement
=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

Suppose ten independent inspections each have success probability 0.5. Put 10 in J2, 0.5 in K2, 3 in L2 and 5 in M2. =B(J2;K2;L2;M2) gives 0.568359375, approximately 56.84%, for three, four or five successes. Label whether “success” means a pass or a defect; reversing that definition changes the supplied probability.

Omitting M2 asks for exactly three successes, not at most three. The three-argument result is 0.1171875. For zero through three, use =B(10;0.5;0;3), whose independently calculated probability is 0.171875.

Advanced interpretation and checks

An exact count of arrangements gives (120+210+252)/1024=0.568359375 for the first row. A separate cumulative expression is =BINOMDIST(5;10;0.5;TRUE())-BINOMDIST(2;10;0.5;TRUE()). Subtract at one count below the lower bound so that exactly three remains included.

At a zero lower bound, use the upper cumulative probability alone rather than evaluating BINOMDIST at −1. In ten fair die throws, =B(10;1/6;2) gives approximately 0.290710049202 for exactly two sixes. This probability depends on the assumed independent fair throws.

For positive a and b, Euler’s beta function instead has the mathematical expression =EXP(GAMMALN(a)+GAMMALN(b)-GAMMALN(a+b)). At a=2 and b=3 that equals 1/12. It is a composition of other functions, not the invalid two-argument call B(2;3).

Boundaries and troubleshooting

The source rejects reversed count limits and counts outside the trial range; it does not clip them automatically. Probability 0 concentrates the mass at zero successes, while probability 1 concentrates it at Trials. A valid range covering the entire count support has probability 1.

Fractional counts are floored, not interpolated. A successful result after flooring does not establish that a measured count or an upstream formula was sensible. The worksheet English name and a file-format storage alias are separate identities; preserve the name actually recognized after importing a workbook.

The following boundary formulas were recalculated in the same named method. H5 and H6 are deliberately empty cells where referenced. An error display remains an error even if the underlying ODS numeric attribute stores zero.

Formula Native result or error
=B(10;0.5;5;3) Err:502
=B(10;0.5;11) Err:502
=B(10.9;0.5;3.9;5.9) 0.568359375

Tested import limitation

The separate XLSX input produced a quoted ‘B’ identifier and Err:509 for these cases. Those results identify an import-path failure, not the native function’s calculation. The successful results above came from generated ODF formulas followed by hard recalculation; they were not manually typed.

The 4.1.16 OpenFormula name map uses B for SC_OPCODE_B, and that is the name serialized in the native ODF fixture. Do not substitute another product’s storage alias without checking this release’s own mapping.

Official evidence and checking scope

The retained input and saved ODS preserve the tested formula identities. A stale SUM cache changed from 999999 to 3, and an uncached SUM returned 7 after hard recalculation. Native evidence is limited to the eight reference formulas and listed boundary cases in this exact release and method. Composite explanatory examples are independent calculations unless listed among those cases; other releases, locales and extreme-parameter accuracy were not established.