RANDEXP Function (Gnumeric)
RANDEXP(b) uses the exponential scale, equal to the ideal mean, rather than a rate. Its source does not reject a zero unit driver, so that endpoint can produce #NUM!, even when b is zero.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: RANDEXP(b) uses the exponential scale, equal to the ideal mean, rather than a rate. Its source does not reject a zero unit driver, so that endpoint can produce #NUM!, even when b is zero.
Syntax
=RANDEXP(b)
Availability and evidence
- Introduction: Gnumeric 0.49 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 exact source behavior
The required b argument must be nonnegative. A negative value returns #NUM! through the helper’s NaN result. For positive b, the ideal exponential distribution has mean b, standard deviation b and variance b². If an input is a rate lambda, convert it to scale 1/lambda before calling this function.
The helper computes -b*LN(U) from its unit generator. Unlike the neighboring Weibull and Rayleigh helpers, it has no retry for U=0. A zero driver therefore leads to non-finite arithmetic, which the result constructor converts to #NUM!. This is a source-derived possible branch, not an observed failure frequency or a claim that the next draw will fail.
Complete worksheet setup
Create ExponentialControls. Put scale 5 in B2. In D2 enter =RANDEXP($B$2). It returns a changing variate or a numerical error on a non-finite path; there is no fixed expected draw.
In F2 enter =B2, in F3 =B2^2, and in F4 =1/B2. The independent results are 5, 25, and 0.2, respectively the ideal mean, variance and corresponding rate. The rate 0.2 is not an interchangeable argument for the scale 5.
Deterministic transform controls
Put 0.25,0.5 and 0.75 in A7:A9. In B7 enter =-$B$2*LN(A7) and fill down. These supplied drivers yield:
| Supplied control inputs | Independent reference result |
|---|---|
| U=.25 | 6.931471805599 |
| U=.5 | 3.4657359028 |
| U=.75 | 1.438410362259 |
The mapping decreases as U increases. For a lower-tail cumulative probability p, use U=1-p instead. In particular, the ideal median is =B2*LN(2), approximately 3.4657359028, below the mean 5.
The controls avoid U=0. They establish the scale interpretation and logarithmic transformation without pretending to execute Gnumeric’s random generator.
Advanced: convert a rate correctly
If an illustrative process model specifies rate 0.2 per minute, place 0.2 in H2 and use =RANDEXP(1/H2). The ideal mean waiting time is 5 minutes. Entering =RANDEXP(H2) instead would use mean 0.2 minutes, a different model by a factor of 25.
A valid exponential model requires a positive rate for this conversion. A zero or negative rate is not repaired by silently substituting a positive scale. This example explains arithmetic units; it does not validate any real arrival process.
Advanced: tail and memoryless calculations
For the ideal scale 5 distribution, the probability of exceeding 10 is =EXP(-10/$B$2), approximately 0.135335283237. The probability of being at most 10 is approximately 0.864664716763.
The ideal conditional probability of exceeding 15 given survival beyond 10 is the ratio EXP(-15/5)/EXP(-10/5), which equals EXP(-5/5), approximately 0.367879441171. This memoryless identity is about conditional probabilities, not a promise that an individual future draw ignores all workbook state.
A single D2 result cannot estimate those probabilities. The fixed formulas provide reproducible theoretical checks separately from changing simulated observations.
Advanced: distinguish one draw from a sum
Three independent ideal scale 5 exponential variables have sum mean 15 and variance 75. Their sum has a gamma distribution with shape 3 and scale 5. Conversely, three references to one random value sum to three times that value, whose variance is 225 rather than 75.
When a worksheet is intended to model independent waiting times, keep separate calls and state the independence assumption. Do not use multiplication of one random cell as a shortcut for a sum of independent observations.
Zero scale is conditional, not a guaranteed constant
=RANDEXP(-5) is the negative-scale #NUM! control. With b=0 and a positive driver, the transform is 0. With b=0 and U=0, zero times the logarithmic infinity is non-finite and becomes #NUM!. There is no explicit early return for b=0.
Thus this guide deliberately does not label RANDEXP(0) an unconditional zero-valued worksheet formula. The exact driver endpoint and its finite generator probability were not measured, and no native test was attempted to provoke it.
Recalculation and evidence limits
The plugin registers this function as volatile, so recalculation can replace its result. There is no worksheet seed argument in the signature shown here. Exact GUI triggers, saved-file replay and cross-application transfer were not tested. Two calls do not promise the same underlying driver; repeated references to one random cell do not create independent observations.
The supplied driver values and mathematical summaries are deterministic teaching controls. They are not captured random samples. Ideal continuous distributions differ from a finite-resolution generator: rounding, underflow, overflow and endpoint treatment can matter. Non-finite arithmetic is converted to #NUM! by the numeric result constructor. Explicit finite numeric inputs are used throughout; text/blank coercion and locale-sensitive parsing are outside this verification.