R.QGEOM Function (Gnumeric)
Find geometric waiting-count quantiles with Gnumeric R.QGEOM. Translate failures to attempts, check tail conventions and understand probability endpoints.
Verification status: 24 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.QGEOM(.5,.2) gives 3 in Gnumeric 1.12.57.
Availability and version history
- Introduced: First release not established; present in the retained 1.12.57 source.
- 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.QGEOM returns
R.QGEOM selects a failure-count threshold for the geometric distribution. At an interior lower-tail probability a, its mathematical threshold is the smallest integer k with 1−(1−p)^(k+1)≥a. The source uses a small rounding adjustment to retain left continuity at exact jumps. Versioned function help.
Syntax and arguments
=R.QGEOM(probability,success_probability[,lower_tail[,log_p]])
- probability: required probability in [0,1], or its natural logarithm.
- success_probability: required per-trial success chance, 0<p≤1.
- lower_tail: optional TRUE for a lower-tail probability; FALSE supplies the strict upper-tail probability.
- log_p: optional FALSE. TRUE means the input is a natural logarithm, such as LN(0.1), rather than 0.1.
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.QGEOM(.5,.2) |
3 |
=R.QGEOM(.9,.2) |
10 |
=R.QGEOM(.2,.2) |
0 |
=R.QGEOM(.8,.2,FALSE()) |
0 |
=R.QGEOM(LN(.1),.2,FALSE(),TRUE()) |
10 |
=R.QGEOM(.5,.5) |
0 |
=R.QGEOM(0,.2) |
0 |
=R.QGEOM(1,1) |
0 |
Practical worksheet
At a 20% chance of success per independent attempt, the 90% failure-count quantile is 10. This corresponds to allowing eleven attempts. Ten attempts succeed with probability 1−0.8^10=0.8926258176, while eleven reach 1−0.8^11=0.91410065408. Adding one converts failures into the attempt number of the first success.
Advanced interpretation and checks
For interior a and p, the unadjusted analytic expression is CEILING(LN(1−a)/LN(1−p)−1), bounded below by zero. The native implementation adds a small tolerance before the ceiling. At a=0.2 and p=0.2, zero failures is already enough. Verify a computed threshold with the CDF on both neighboring integers instead of demanding that the CDF equal the requested probability.
The saved advanced-check result for =R.PGEOM(R.QGEOM(.9,.2),.2) was 0.91410065408.
Boundaries and troubleshooting
When p<1, the probability-one quantile is unbounded and becomes #NUM!. When p=1, the helper validates the probability first and then returns zero, including probability 1. Thus R.QGEOM(1.1,1) still errors. This ordering differs from R.QNBINOM’s degenerate branches. Invalid success probabilities and nonnumeric text fail rather than describing an infinite-waiting worksheet value.
F5 is genuinely empty, rather than a cell containing an empty string.
| Formula | Gnumeric 1.12.57 result |
|---|---|
=R.QGEOM(1,.2) |
#NUM! |
=R.QGEOM(0,.2,FALSE()) |
#NUM! |
=R.QGEOM(1,.2,FALSE()) |
0 |
=R.QGEOM(-.1,.2) |
#NUM! |
=R.QGEOM(1.1,.2) |
#NUM! |
=R.QGEOM(.5,0) |
#NUM! |
=R.QGEOM(.5,-.1) |
#NUM! |
=R.QGEOM(.5,1.1) |
#NUM! |
=R.QGEOM(1.1,1) |
#NUM! |
=R.QGEOM(0,.2,TRUE(),TRUE()) |
#NUM! |
=R.QGEOM(1,.2,TRUE(),TRUE()) |
#NUM! |
=R.QGEOM("abc",.2) |
#VALUE! |
=R.QGEOM(F5,.2) |
0 |
=R.QGEOM(.5) |
#N/A |
=R.QGEOM(.5,.2,1,0,1) |
#N/A |
Official evidence and checking scope
- Current worksheet callback
- Tested-version worksheet callback
- Current qgeom calculation
- Tested-version qgeom calculation
- Nonfinite worksheet-value handling
- Statistical Functions From R plugin declaration
- Quantile boundary convention
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.