Contact

RANDGEOM Function (Gnumeric)

Statistical Intermediate Gnumeric Gnumeric 1.1.6

RANDGEOM(p) counts failures before the first success, so its ideal support starts at 0. The helper requires 0<p≤1, even though the worksheet help’s invalid-range note omits the p=0 boundary.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Quick answer: RANDGEOM(p) counts failures before the first success, so its ideal support starts at 0. The helper requires 0<p≤1, even though the worksheet help’s invalid-range note omits the p=0 boundary.

Syntax

=RANDGEOM(p)

Availability and evidence

  • Introduction: Gnumeric 1.1.6 NEWS explicitly lists this new function. This release-history evidence is separate from a native test of that old version.
  • Source support: Registered in the Gnumeric 1.12.62 random plugin. No retirement is established; the last functioning native application version is unverified.
  • Evidence dates: Official Gnumeric source retained October 13–14, 2026 was reviewed October 15. Mathematical controls were independently recalculated October 15. No native application, compiled Gnumeric helper or random generator was executed.

Parameter and implemented support

The single required p is a success probability. The callback rejects values below 0 or above 1, and the helper additionally rejects p=0. Thus the implemented valid range is 0<p≤1. A rejected boundary produces #NUM! through the numeric result constructor.

At p=1 the helper returns 0 immediately: the first trial succeeds, so there are no preceding failures. For 0<p<1 it retries a zero unit driver U and computes FLOOR(LN(U)/LN(1-p)) mathematically, using log1p in the source for the denominator.

The source explicitly uses support 0,1,2,…, rather than the alternative geometric convention counting all trials 1,2,3,…. Add 1 only when the intended output is the total number of trials through the first success.

Complete worksheet setup

Create GeometricControls. Put success probability 0.25 in B2. In D2 enter =RANDGEOM($B$2). In D3 enter =D2+1 for the corresponding total-trials count from that same draw.

The ideal failure-count mean is (1-p)/p, or 3; its variance is (1-p)/p^2, or 12. The ideal mean of D3 is 4, while its variance remains 12. Neither D2 nor D3 has a fixed expected draw.

Deterministic driver controls

Put 0.1,0.3,0.6 and 0.9 in A7:A10. In B7 enter =INT(LN(A7)/LN(1-$B$2)) and fill down. The positive ratios make INT equivalent to the mathematical floor in these controls:

Supplied input or fixed count Independent reference result
U=.1, p=0.25 8
U=.3, p=0.25 4
U=.6, p=0.25 1
U=.9, p=0.25 0

These supplied drivers stay away from exact transition boundaries. Near such boundaries, finite LN/log1p calculations and rounding need their own numerical treatment; this table does not certify bit-for-bit agreement for every possible driver.

Advanced: fixed-count probabilities

For failure count k≥0, the ideal probability is (1-p)^k*p. With p 0.25, probabilities for k 0,1,2 and 3 are 0.25, 0.1875, 0.140625, and 0.10546875. Their sum is 0.68359375.

Thus the probability of at least 4 failures is 0.31640625, equal to 0.75^4. If counting total trials instead, that same event is at least 5 trials. Off-by-one errors arise when these two conventions are mixed.

Advanced: change success probability by meaning

At p 0.5 the ideal failure-count mean is 1 and variance 2. At p 0.25 the mean is 3 and variance 12. Halving p does not merely double the mean failure count because the formula includes subtraction of 1 through (1-p)/p.

The expected total-trials count is 1/p, which changes from 2 to 4. State whether a table describes failures or trials before comparing expected values across scenarios.

Advanced: memoryless survival

For the ideal failure-count convention, the probability of at least k failures is (1-p)^k. The conditional probability of at least 7 failures given at least 4 is therefore 0.75^7/0.75^4, or 0.421875, matching the probability of at least 3 failures from the start.

This is a mathematical conditional-probability identity. It is not a claim that recalculating a workbook preserves or resets a particular real-world trial history.

Boundary and error controls

=RANDGEOM(1) gives 0, while =RANDGEOM(0), =RANDGEOM(-0.1) and =RANDGEOM(1.1) give #NUM!. The explicit p=0 helper guard is important; a generic note saying only p<0 is invalid does not fully specify the implementation.

The integer output is a variate, not a probability. A returned 8 means eight failures before success under this convention, not an 80% probability and not eight total trials.

Recalculation and verification limits

The plugin marks this function volatile. Recalculation can replace a result, and the worksheet signature has no seed argument. Exact GUI triggers and saved-file replay were not tested. Separate calls do not promise matched internal drivers, while repeated references to one random cell do not constitute independent observations.

The controls here are independent mathematical or source-branch expectations, not generated samples. Ideal probability distributions are distinct from the finite-resolution implementation. Rounding, underflow, overflow and non-finite intermediates can affect extreme inputs; non-finite numeric results become #NUM!. No native application, compiled Gnumeric helper, random generator, empirical distribution-quality test or file-transfer test was executed. Use explicit finite numeric inputs; text and blank coercion are not certified by these controls.