Contact

R.QBINOM Function (Gnumeric)

Statistical Intermediate Gnumeric

Find binomial count thresholds with Gnumeric R.QBINOM. Understand discrete inverse jumps, upper-tail conversion, strict integer trials and endpoint conventions.

Verification status: 27 reference, boundary and advanced-check formulas were recalculated with Gnumeric 1.12.57 ssconvert. Saved identities, the blank input and numerical results were independently checked. Gnumeric 1.12.62 was source-checked only. How formula examples are checked

Quick answer: =R.QBINOM(.5,5,.5) gives 2 in Gnumeric 1.12.57.

Availability and version history

  • Introduced: First release not established; named in Gnumeric 1.12.1 release notes.
  • Supported in: Gnumeric 1.12.62; no retirement is established.
  • Scope: Desktop Gnumeric with its Statistical Functions From R plugin. English comma-separated formulas are shown.
  • Checked: October 14, 2026. Tables and the named advanced check use 1.12.57 ssconvert. Current 1.12.62 source was inspected; that release was not executed.

What R.QBINOM returns

For an interior lower probability p, R.QBINOM returns the smallest integer count whose cumulative probability reaches p. A discrete inverse usually cannot make the cumulative value equal p exactly. Endpoint and degenerate cases also follow explicit source conventions. Versioned function help.

Syntax and arguments

=R.QBINOM(probability,trials,success_probability[,lower_tail[,log_p]])
  • probability: lower target probability by default, or upper probability when lower_tail is FALSE.
  • trials: nonnegative integer; this helper uses a stricter integrality check than R.DBINOM or R.PBINOM.
  • success_probability: per-trial probability in [0,1].
  • lower_tail: optional TRUE for the lower cumulative probability; FALSE requests the upper tail.
  • log_p: optional FALSE. TRUE uses natural-log probabilities, not base-10 logarithms.

Brackets mark optional arguments; do not type them. Current worksheet implementation.

Reproducible examples

These self-contained formulas were recalculated natively. Ordinary-domain results were checked against independent mathematics; source guards explain the boundary cases. Results are rounded to twelve decimal places, or thirteen significant digits for small nonzero values. This is presentation precision, not a universal accuracy guarantee.

Formula Gnumeric 1.12.57 result
=R.QBINOM(.5,5,.5) 2
=R.QBINOM(.75,5,.5) 3
=R.QBINOM(.9,5,.5) 4
=R.QBINOM(.25,5,.5,FALSE()) 3
=R.QBINOM(LN(.25),5,.5,FALSE(),TRUE()) 3
=R.QBINOM(.3,10,.4) 3
=R.QBINOM(0,5,.5) 0
=R.QBINOM(1,5,.5) 5

Practical worksheet

With five trials and success probability 0.5, target 0.75 returns 3. The cumulative probability at 2 is 0.5, while at 3 it is 0.8125. Thus 3 is the first integer threshold reaching the target, even though 0.8125 is not 0.75.

With ten trials and success probability 0.4, target 0.3 also returns 3: the independent cumulative probabilities at 2 and 3 are 0.1672897536 and 0.3822806016. Do not interpolate a fractional count between those jumps.

Advanced interpretation and checks

Upper-tail input 0.25 selects the same count as lower-tail input 0.75. Its meaning is a complementary target, not a requirement that the strict upper cumulative probability equal 0.25 exactly. The source slightly adjusts a search probability for floating-point continuity near cumulative jumps.

Log mode can use LN(0.25) with lower_tail FALSE and log_p TRUE. In the saved advanced check, evaluating R.PBINOM at the returned 0.75 quantile produces 0.8125, deliberately demonstrating the discrete jump rather than an exact continuous inverse.

The saved advanced-check result for =R.PBINOM(R.QBINOM(.75,5,.5),5,.5) was 0.8125.

Boundaries and troubleshooting

Endpoint conventions precede degenerate-distribution shortcuts. In default lower-tail mode, p=0 returns 0 and p=1 returns n, even when the success probability is respectively 1 or 0. Thus the tested R.QBINOM(1,5,0) returns 5, although all distribution mass is at zero. Validate the intended endpoint convention before using a threshold for a degenerate model.

Trials 5.000000000000001 give #NUM! here, unlike the tolerant mass/CDF helpers. Negative or fractional trials, invalid success probabilities and invalid target probabilities also error. Empty p becomes zero; log input zero means ordinary probability one. Nonnumeric text is #VALUE! and incorrect arity is #N/A.

F5 is genuinely empty, rather than a cell containing an empty string.

Formula Gnumeric 1.12.57 result
=R.QBINOM(-.1,5,.5) #NUM!
=R.QBINOM(1.1,5,.5) #NUM!
=R.QBINOM(.5,5.9,.5) #NUM!
=R.QBINOM(.5,-1,.5) #NUM!
=R.QBINOM(.5,5,-.1) #NUM!
=R.QBINOM(.5,5,1.1) #NUM!
=R.QBINOM(.5,0,.5) 0
=R.QBINOM(.5,5,0) 0
=R.QBINOM(.5,5,1) 5
=R.QBINOM(1,5,0) 5
=R.QBINOM(0,5,1) 0
=R.QBINOM(.5,5.000000000000001,.5) #NUM!
=R.QBINOM(0,5,.5,TRUE(),TRUE()) 5
=R.QBINOM(1,5,.5,TRUE(),TRUE()) #NUM!
=R.QBINOM("abc",5,.5) #VALUE!
=R.QBINOM(F5,5,.5) 0
=R.QBINOM(.5,5) #N/A
=R.QBINOM(.5,5,.5,1,0,1) #N/A

Official evidence and checking scope

The relevant complete worksheet callback and main calculation helper are unchanged between the inspected versions. That does not establish later-version numerical execution. Both stale and uncached SUM controls recalculated correctly. Native XML preserves the R.* identities. The secondary ODF export keeps these calls in the ORG.GNUMERIC namespace; it does not establish execution in another product. GUI entry, other locales and other spreadsheet products were not tested.