RANDTDIST Function (Gnumeric)
RANDTDIST(df) generates a Student t variate with positive degrees of freedom. Fractional df is allowed; the ideal variance is df/(df-2) only when df>2.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: RANDTDIST(df) generates a Student t variate with positive degrees of freedom. Fractional df is allowed; the ideal variance is df/(df-2) only when df>2.
Syntax
=RANDTDIST(df)
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 source branches
The single df argument is required and must be strictly positive. Zero or negative df leads to #NUM!. It is not converted to an integer before generation. Positive noninteger df therefore represents a legitimate source input rather than an instruction to truncate.
The helper uses different algorithms on the two sides of df=2. For df≤2 it divides a standard-normal variate by SQRT(Q/df), where Q comes from the chi-square helper. For df>2 it uses a rejection algorithm driven by normal and exponential helpers. A normal/chi-square ratio is a useful ideal distribution construction for all positive df, but is not the actual code path for df>2.
Complete worksheet setup
Create TDistributionControls. Put degrees of freedom 5 in B2. In D2 enter =RANDTDIST($B$2). D2 is changing and can be positive or negative; no fixed expected draw is supplied.
The ideal mean is 0 because df>1. In F2 enter =B2/(B2-2) and in F3 =SQRT(F2). These give variance 5/3, approximately 1.66666666667, and standard deviation approximately 1.29099444874. The value 5 is a shape parameter, not the standard deviation.
Deterministic construction controls
For a separate df 2 construction, put 2 in H2 for df and 2 in H3 for a supplied Q. Put -2,-1,0,1 and 2 in A7:A11. In B7 enter =A7/SQRT($H$3/$H$2) and fill down:
| Supplied input or fixed count | Independent reference result |
|---|---|
| Z=-2, Q=2, df=2 | -2.0 |
| Z=-1, Q=2, df=2 | -1.0 |
| Z=0, Q=2, df=2 | 0.0 |
| Z=1, Q=2, df=2 | 1.0 |
| Z=2, Q=2, df=2 | 2.0 |
These fixed Z values and Q are not random draws. The table checks the ratio arithmetic used by the df≤2 branch. It does not establish that D2, whose df is 5, will return those values or use that branch.
Advanced: inspect a safe df 5 rejection-branch control
The df>2 source sets Z=Y1²/(df-2). For supplied Y1=1, Y2=1 and df 5, Z=1/3. The acceptance comparison is EXP(-Y2-Z) versus 1-Z; approximately 0.263597138116 is not greater than 2/3, so this supplied pair passes.
The resulting mathematical transform is 1/SQRT((1-2/5)*(1-1/3)), approximately 1.58113883008. These are deterministic internal-driver controls, not a simulation of the generator’s rejection frequency or observed native output.
A supplied Y1=2 gives Z=4/3, so 1-Z<0 and the source rejects before accepting an output. Checking the retry condition separately is important; inserting arbitrary numbers into only the final transform would ignore the algorithm’s guard.
Advanced: the Cauchy and moment boundaries
At df 1 the ideal t distribution is the standard Cauchy distribution. Its median is 0, but no finite mean or variance exists. At df 2 the ideal mean exists and is 0, while variance is not finite. At df 3 the variance is 3.
Thus symmetry does not automatically justify a finite mean or variance. A finite worksheet sample may have a numerical average, but that does not create a finite population moment where the ideal model lacks one.
Advanced: a location and scale transformation
The function itself has neither location nor scale arguments. For the original df 5 result, =10+2*D2 uses location 10 and multiplier 2. Its ideal mean is 10, variance is 20/3, and standard deviation approximately 2.58198889747.
The multiplier 2 is not the transformed output standard deviation, because the base t distribution has variance 5/3. If a desired standard deviation were 2 instead, use multiplier =2/SQRT(5/3) rather than 2.
The formula deliberately references D2 to preserve the same draw. A separate RANDTDIST call would not promise a matching value, and repeated references to D2 are not independent observations.
Errors and ordinary-domain scope
=RANDTDIST(0) and =RANDTDIST(-1) give #NUM!. =RANDTDIST(2.5) is accepted as a fractional-df model, with ideal variance 5. Extreme tails and the numerical boundaries of the rejection algorithm were not experimentally characterized; a theoretical unbounded range is not a guarantee of every machine magnitude.
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.