RANDWEIBULL Function (Gnumeric)
RANDWEIBULL(a,b) uses scale first, shape second. For scale 100 and shape 2, the ideal median is about83.2555; an individual random result is not fixed.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: RANDWEIBULL(a,b) uses scale first, shape second. For scale 100 and shape 2, the ideal median is about83.2555; an individual random result is not fixed.
Syntax
=RANDWEIBULL(a,b)
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.
Parameters and source contract
Both arguments are required. Scale a must be nonnegative and shape b strictly positive. Negative scale or zero/negative shape produces #NUM!. With valid shape, scale zero returns 0 immediately. The order differs from APIs that put shape before scale, so copy arguments by meaning rather than position.
For positive scale the helper repeatedly obtains a unit driver U until U is nonzero, then computes a*(-LN(U))^(1/b). This is a transformation of the survival probability: a smaller U gives a larger result. The ideal cumulative probability at nonnegative x is 1-EXP(-((x/a)^b)).
Complete worksheet setup
Create WeibullControls. Put scale 100 in B2 and shape 2 in B3. In D2 enter =RANDWEIBULL($B$2,$B$3). It returns a changing variate; there is no fixed expected D2 value.
In F2 enter =$B$2*LN(2)^(1/$B$3) for the ideal median. The independent result is approximately 83.2554611158. In F3 enter =1-EXP(-1); the result 0.632120558829 is the ideal probability of a value at or below the scale 100, regardless of positive shape. Thus the scale is neither necessarily the mean nor the median.
Deterministic transformation controls
Put 0.25, 0.5 and 0.75 in A7:A9. In B7 enter =$B$2*(-LN(A7))^(1/$B$3) and fill through B9. These are supplied drivers, not generated samples:
| Supplied input or control | Independent reference result |
|---|---|
| U=.25 | 117.7410022515 |
| U=.5 | 83.25546111577 |
| U=.75 | 53.63600213027 |
The controls intentionally decrease as U increases. If instead starting from a cumulative probability p, substitute U=1-p; do not use p unchanged while calling the result its lower-tail quantile. Neither a literal U=0 nor a probability p=1 belongs in this finite inverse-transform worksheet.
Advanced: shape 1 is the exponential model
Keep scale 100 but change shape to 1. The ideal mean is100 and the median is 100*LN(2), approximately 69.31471805599. The transform becomes -100*LN(U) rather than the square root used at shape 2.
With shape 2, the ideal mean is 100*SQRT(PI())/2, approximately 88.6226925453, and variance is 10000*(1-PI()/4), approximately 2146.01836603. These follow from the distribution’s moments; they are not exact averages that a finite worksheet sample must reproduce.
Changing shape affects both central tendency and spread even while the scale remains100. Therefore a comparison holding a fixed average must rederive the scale rather than merely changing B3.
Advanced: threshold and scaling calculations
For the original scale 100/shape 2 model, the ideal probability of exceeding150 is =EXP(-((150/$B$2)^$B$3)), approximately 0.105399224562. This is a theoretical tail probability, not a count observed from D2.
Doubling scale to200 doubles the transform for each supplied driver. The median becomes approximately 166.510922232 and the ideal mean 177.245385091. To demonstrate the same-draw scaling in a worksheet, reference an already calculated random cell and multiply by two. Separate RANDWEIBULL calls need not use matching drivers.
Boundary and error controls
=RANDWEIBULL(0,2) gives 0 by an explicit early return. =RANDWEIBULL(0,0) still gives #NUM!, because shape validation occurs before the zero-scale branch. =RANDWEIBULL(-1,2) and =RANDWEIBULL(100,-2) are also #NUM! controls.
Finite-resolution arithmetic can underflow or overflow for extreme parameters. The mathematical positive support for positive scale is not a promise about every machine endpoint. This guide does not claim native tail coverage or endorse this model for a particular reliability dataset.
Working with a changing result
The function is registered as volatile. A recalculation can replace its result; neither a copied screenshot nor an earlier value is a promised next draw. There is no seed argument in this function’s worksheet signature. Exact recalculation triggers, shared-generator sequencing and saved-file replay were not tested.
The controls below separate a changing random formula from deterministic arithmetic. The supplied driver values are teaching inputs, not values captured from Gnumeric’s generator. Population summaries describe the ideal continuous distribution and are not empirical certifications of the finite-resolution implementation.
Troubleshooting and verification limits
Use explicit finite numeric inputs for these controls. Text parsing, blank-cell coercion, locale-specific separators and array broadcasting are outside the verified examples. The numeric result constructor turns non-finite arithmetic into #NUM!; very large parameters or extreme transformed values can therefore fail even when the mathematical distribution is defined.
The underlying unit generator has finite resolution. Endpoint exclusions, rounding, overflow and underflow mean a theoretical continuous distribution is not a literal list of every machine output. No random samples, native worksheet execution, distribution-quality test, GUI operation or cross-application file transfer was performed for this guide. The executable checks verify deterministic transformations and mathematical reference values only.