Statistical functions

T.DIST.2T

Close: 1 of 4 recorded answers differ in the last bits, worst 11 ULP

Everything else matches (4 workbook cells). Last-bit means a finite number within 16 ULP of Excel's. How we measure this · See the Rust code

Local names in 40 languages
LanguageName in Excel
ArabicT.DIST.2T
BulgarianT.DIST.2T
CzechT.DIST.2T
DanishT.FORDELING.2T
GermanT.DIST.2T
GreekT.DIST.2T
English (Australia)T.DIST.2T
English (United Kingdom)T.DIST.2T
English (United States)T.DIST.2T
SpanishDISTR.T.2C
EstonianT.DIST.2T
FinnishT.JAKAUMA.2S
FrenchLOI.STUDENT.BILATERALE
HebrewT.DIST.2T
CroatianT.DIST.2T
HungarianT.ELOSZLÁS.2SZ
IndonesianT.DIST.2T
ItalianT.DIST.2T
JapaneseT.DIST.2T
KoreanT.DIST.2T
LithuanianT.DIST.2T
LatvianT.DIST.2T
NorwegianT.DIST.2T
DutchT.DIST.2T
PolishROZKŁ.T.DS
Portuguese (Brazil)T.DIST.2T
Portuguese (Portugal)DIST.T.2C
RomanianT.DIST.2T
RussianСТЬЮДЕНТ.РАСП.2Х
SlovakT.DIST.2T
SlovenianT.DIST.2T
Serbian (Latin)T.DIST.2T
SwedishT.FÖRD.2T
ThaiT.DIST.2T
TurkishT.DAĞ.2K
UkrainianT.DIST.2T
VietnameseT.DIST.2T
Chinese (Simplified)T.DIST.2T
Chinese (Hong Kong)T.DIST.2T
Chinese (Traditional)T.DIST.2T

Names from Microsoft's support site.

What it does

T.DIST.2T(x, deg_freedom)

T.DIST.2T(x, deg_freedom) returns the two-tailed area of Student's t-distribution with ν degrees of freedom:

T.DIST.2T(x, ν) = P(|T| > x) = 2 · P(T > x) = 2 · (1 − F(x; ν))

for x ≥ 0, where F is the cumulative distribution function given on T.DIST. Because the t-distribution is symmetric about zero, the two tails are equal and the factor of two is exact rather than an approximation.

In terms of the regularized incomplete beta function, again exactly:

T.DIST.2T(x, ν) = I_{ν/(ν+x²)}(ν/2, ½)

— note that the ½ prefactor that appears in the one-tail form has cancelled against the doubling. The two-tail area is, in the beta parameterization, the simpler object of the three t surfaces.

Domain and range: x ≥ 0 (Microsoft documents #NUM! below zero), ν > 0. The value falls strictly from 1 at x = 0 to 0 as x → ∞. T.DIST.2T(0, ν) = 1 exactly, for every ν: the whole distribution is more than zero away from zero in absolute value, apart from a null set.

Elementary closed forms at the small integer degrees of freedom:

νT.DIST.2T(x, ν) for x ≥ 0
11 − 2·arctan(x)/π
21 − x / sqrt(x² + 2)
ν → ∞2(1 − Φ(x)) = ERFC(x/sqrt 2)

That ν = 2 row is worth pausing on: the two-tail t-distribution at two degrees of freedom is an elementary rational-algebraic function, computable to the last bit with a square root and a division. Anything an implementation publishes there can be checked against arithmetic.

Arguments

ArgumentMeaningRequired
xThe numeric value at which the distribution is evaluated. Documented as non-negative.Yes
deg_freedomν, "an integer indicating the number of degrees of freedom" (Microsoft).Yes

x < 0 is documented as #NUM!. This is the one member of the modern t trio that keeps the legacy TDIST domain restriction, and it is worth knowing why it is not merely legacy baggage: P(|T| > x) for negative x is identically 1, so the natural extension is a constant and carries no information. Refusing it is a defensible design choice rather than an oversight — though it does mean T.DIST.2T is not a total function on the reals the way T.DIST.RT is documented to be.

The page describes deg_freedom as an integer and does not say what a non-integer value does. The inverse pages (T.INV, T.INV.2T) document truncation for the same parameter; the three T.DIST* pages are silent.

Numeric slots take ordinary to-number coercion; see Coercion and lifting.

Try it

Input cells (optional)

Example: {"B2": 3, "B3": 4}. A1 holds the formula. Other cells need values before a formula can read them.

Enter a formula, then calculate.

Runs locally in your browser with OneCalc. Its answer may differ from Excel. Use English function names and commas between arguments.

Quirks

Result and edge cases

Returns Number, a probability in (0, 1].

  • x = 0 is exactly 1 — one of only two exact values this surface has, and free to check.
  • Large x gives a small p-value decaying like x^(−ν). As with T.DIST.RT, the value stays representable and informative deep into the tail provided it is not formed by subtraction from one.
  • Small x, near zero, is the opposite hazard: here the answer is close to 1, and the interesting quantity is 1 − T.DIST.2T(x, ν), which no Excel surface exposes directly. A reader wanting the central probability accurately should use T.DIST(x, ν, TRUE) − T.DIST(−x, ν, TRUE), or, better, 2·T.DIST(x, ν, TRUE) − 1 — and should know that all three routes lose digits near x = 0.
  • The doubling identity. T.DIST.2T(x, ν) = 2 · T.DIST.RT(x, ν) is exact in real arithmetic, and multiplication by two is exact in binary floating point. So if Excel computes the two surfaces from one internal quantity, the published bits must satisfy the identity exactly, and if they do not, the two surfaces have different internals. That is a rare situation: a metamorphic probe whose failure is as informative as its success, requiring no external oracle.

Errors

As documented on Microsoft's T.DIST.2T page:

ErrorDocumented condition
#VALUE!Any argument is nonnumeric.
#NUM!deg_freedom < 1.
#NUM!x < 0.

Errors in either argument propagate under the universal coercion rule. The Handbook has not verified any of this against Excel.

How to implement

Numerical notes

The two-tail area is the cleanest of the three t surfaces to compute, because in the beta parameterization it is I_{ν/(ν+x²)}(ν/2, ½) with no prefactor and no complementation. An implementation that computes it directly inherits the full relative accuracy of its incomplete beta routine across the whole tail.

The traps are the ones the identity invites rather than the ones the formula contains:

  1. Do not compute it as 2 * (1 − T.DIST(x, ν, TRUE)). The inner subtraction destroys the tail before the doubling can restore anything.
  2. Do not compute the central probability as 1 − T.DIST.2T(x, ν) for small x. That is the same mistake mirrored, and it is the one a spreadsheet user is likelier to make, because Excel offers no surface for the central probability.
  3. Argument reduction. z = ν/(ν + x²) should be formed so that neither x² overflows nor the small complement x²/(ν + x²) is lost. Keeping the complement and calling a complementary incomplete-beta entry point handles both.

For the continued-fraction evaluation of I_z(a, b) the standard reference is Numerical Recipes' betacf, with the reflection applied so the fraction converges quickly; Cephes' incbet and Boost.Math's ibeta/ibetac are the production treatments worth reading. For integer ν, A&S 26.7.3–26.7.4 give finite closed forms, and A&S 26.7 also tabulates the percentage points that a spreadsheet is standing in for.

Nothing here is a claim about Excel's algorithm. The Handbook does not know it.

Rust code

Show the CalcFunc source of this function

Quoted from the public repository DnaCalc/DnaCalc, crates calc-func and calc-fml, at commit 9e1884369a67. Comments are the source's own. A kernel shared with other functions appears once, on its module page.

T.DIST.2T · 4 lines · calc-func/src/catalogue/distributions.rs on GitHub
42 t_dist_2t "T.DIST.2T" (2, 2) [V "x", V "deg_freedom"] |s, a, sv| {
    let [x, df] = nums::<2>(s, a)?;
    out(s, cft::t_dist_2t_kernel(x, df))
}

Kernels shared with other functions

Argument and result plumbing

  • num catalogue/kit
  • out catalogue/kit

No implementation has been published with a Handbook test suite for this function.

Version differences

No comparison between specific Excel builds is recorded here yet. This does not establish that all builds behave alike.

Alternatives

Relationships

  • TDIST(x, ν, 2) is the legacy spelling of this surface. Caution: the Handbook's alias-pairing record for the legacy/modern collapse names TDIST and T.DIST.RT as one of its five pairs — that is the one-tail correspondence. T.DIST.2T is not a subject of that record, and no evidence in the Handbook's record bears on whether TDIST(x, ν, 2) and T.DIST.2T(x, ν) publish the same bits. They are documented to compute the same number; that is not the same statement.
  • T.DIST.RT — exactly half of this value for x ≥ 0.
  • T.DIST — the left-tail CDF and the density.
  • T.INV.2T is this function's inverse, and Microsoft's T.INV.2T page says so explicitly: it seeks the x with T.DIST.2T(x, ν) = probability, and states that T.INV.2T's precision depends on T.DIST.2T's. T.INV inverts T.DIST instead; confusing the two is the single most common error in this corner of Excel, because both are called "the inverse of the t-distribution" in ordinary speech.
  • CHISQ.DIST.RT is the same shape of object for a different distribution, and ERFC is the ν → ∞ limit up to the sqrt 2 scaling.
  • T.TEST with tails = 2 is the packaged consumer of this quantity.

Named variants

No named variants are recorded yet.

Suggest a correction or contribute an implementation · For agents