Math and trigonometry functions

ACOT

Matches all 16,927 recorded answers

Recorded: 16,924 in the answer bank and 3 workbook cells. How we measure this · See the Rust code

Local names in 40 languages
LanguageName in Excel
ArabicACOT
BulgarianACOT
CzechACOT
DanishARCCOT
GermanACOT
GreekACOT
English (Australia)ACOT
English (United Kingdom)ACOT
English (United States)ACOT
SpanishACOT
EstonianACOT
FinnishACOT
FrenchACOT
HebrewACOT
CroatianACOT
HungarianARCCOT
IndonesianACOT
ItalianACOT
JapaneseACOT
KoreanACOT
LithuanianACOT
LatvianACOT
NorwegianACOT
DutchBOOGCOT
PolishACOT
Portuguese (Brazil)ACOT
Portuguese (Portugal)ACOT
RomanianACOT
RussianACOT
SlovakACOT
SlovenianACOT
Serbian (Latin)ACOT
SwedishARCCOT
ThaiACOT
TurkishACOT
UkrainianACOT
VietnameseACOT
Chinese (Simplified)ACOT
Chinese (Hong Kong)ACOT
Chinese (Traditional)ACOT

Names from Microsoft's support site.

What it does

ACOT(number)

ACOT(number) is the inverse cotangent: the angle whose cotangent is number.

acot: R -> (0, pi),    cot(acot x) = x
  • Domain: all real numbers. Unlike ACOS and ASIN, there is no restriction — cot maps each period onto the whole real line.
  • Range: the open interval (0, pi). Microsoft's Learn reference states the range as 0 to pi. Mathematically the endpoints are approached and never reached: acot(x) -> 0+ as x -> +infinity and acot(x) -> pi- as x -> -infinity.
  • Monotonicity: strictly decreasing on the whole line. acot(-1) = 3pi/4, acot(0) = pi/2, acot(1) = pi/4.
  • Reflection: acot(-x) = pi - acot(x). Antisymmetric about (0, pi/2), like ACOS.
  • Derivative: d/dx acot x = -1/(1 + x^2) — bounded, never zero, and the negative of ATAN's. ACOT is smooth and well conditioned everywhere; the difficulties on this page are about representation, not about conditioning.
  • Asymptotics: acot(x) = 1/x - 1/(3x^3) + 1/(5x^5) - ... for large |x| > 1; near zero, acot(x) = pi/2 - x + x^3/3 - ....

The branch convention, which is the whole point

There are two incompatible conventions for arccotangent in the literature, and Excel picks one:

ConventionRangeBehaviour at x -> 0-
Continuous (Excel, per the Learn reference)(0, pi)continuous through zero: acot(0) = pi/2
Odd, i.e. atan(1/x)[-pi/2, 0) ∪ (0, pi/2]jumps by pi across zero

On the continuous convention the identity is

acot(x) = pi/2 - atan(x)      for every real x

which is smooth everywhere. On the odd convention acot(x) = atan(1/x), which is undefined at zero and discontinuous across it. The two agree for x > 0 and differ by exactly pi for x < 0.

This is not a pedantic distinction. ACOT(-1) is 3pi/4 on Excel's stated convention and -pi/4 on the other, and a formula ported from a language whose acot is atan(1/x) will silently be wrong by pi on every negative input. Abramowitz & Stegun record both conventions; Kahan's branch-cut paper is the standard argument for treating the choice as a real decision.

Arguments

ArgumentMeaningDefault
numberThe cotangent of the angle you want. Required.—

That description is Microsoft's, from the Learn reference: "the cotangent of the angle that you want". No constraint on the argument is documented, and none is needed.

The misunderstood position is, again, not the slot: it is that number is a cotangent, not an angle, and that a reader who wants "the angle whose tangent is x" wants ATAN.

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 — an angle in radians.

  • Zero returns pi/2. This is the case that separates the two branch conventions, and it is the one worth checking first in any implementation.
  • Negative arguments return values in (pi/2, pi) on the documented convention — never negative. A negative result from ACOT would be evidence of the other convention.
  • Very large negative arguments produce results approaching pi from below, and the corresponding question is whether they saturate at exactly pi.
  • Subnormal arguments return pi/2, indistinguishably from zero.
  • Arrays lift elementwise.

Version

ACOT is one of the trigonometric surfaces added in Excel 2013, alongside ACOTH, SEC, CSC, COT and their hyperbolic partners. Workbooks that must open in earlier versions substitute PI()/2 - ATAN(x), which is the same function on the documented convention.

Errors

ErrorConditionSource
#VALUE!The argument does not convert to a numberShared coercion rules
propagatedAn error value in the argument is returned unchangedShared coercion rules

How to implement

Numerical notes

ACOT is analytically the tamest function on this batch of pages — bounded derivative, no singularities, no domain edge — and it has one sharp numerical problem, which comes entirely from how it is usually computed.

Catastrophic cancellation in pi/2 - atan(x). The identity is exact in mathematics. In binary64 it is not: as x grows, atan(x) approaches pi/2, and the subtraction of two nearly equal quantities destroys the relative accuracy of a result that is itself near zero. The failure is progressive and total:

  • The correctly rounded atan(x) becomes exactly the double nearest pi/2 once x exceeds roughly 2^53 — beyond which the subtraction returns a fixed, tiny residue and then, past another threshold, exactly zero.
  • The true acot(x) at those arguments is approximately 1/x, a perfectly representable positive number all the way down to the subnormal floor.
  • So there is a very wide band of arguments — everything above about 1e16, which is more than 290 decades of the double range — on which pi/2 - atan(x) has no correct significant digits at all, and eventually returns a value outside the function's own open range.

This is the mirror image of the ATAN situation: ATAN is accurate for large x because its answer is large; ACOT's answer is small there, and small answers reached by subtraction are where relative accuracy goes to die.

The standard remedy is the reciprocal reduction, and it is one line:

acot(x) = atan(1/x)              for x >=  1        (result in (0, pi/4])
acot(x) = pi + atan(1/x)         for x <= -1        (result in [3pi/4, pi))
acot(x) = pi/2 - atan(x)         for |x| < 1

Inside the unit interval the subtraction is harmless — both terms are of order one and the answer is of order one. Outside it, 1/x is small and atan of a small argument is accurate to the last bit, so acot(x) inherits full relative accuracy right down to the subnormals. Cody & Waite give this reduction for the ATAN/ACOT pair; it is the same trick, run the other way, that makes ATAN accurate for large arguments.

Cost of the remedy: one division and one comparison. There is no accuracy trade-off, no extra polynomial, and no branch subtlety beyond getting the x <= -1 offset right.

A self-test without an oracle. TAN(ACOT(x)) * x should be 1, and ACOT(x) + ACOT(-x) should be PI(). Sweeping the first across many decades of x shows the exact point where the subtraction stops carrying information, without needing any high-precision reference.

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.

ACOT · 1 lines · calc-func/src/catalogue/math.rs on GitHub
3 acot "ACOT" (1, 1) [V "number"] |s, a, sv| { unary(s, a, k::acot::acot_kernel) }
acot_kernel · 20 lines · calc-func/src/ported/acot.rs on GitHub
pub fn acot_kernel(n: f64) -> Result<f64, WorksheetErrorCode> {
    // W111 distinguishes this reciprocal/angle graph from direct atan2 and
    // from a binary64-only reciprocal. It is an observed arithmetic model,
    // not a claim about Excel internals or universal FPATAN parity.
    if n == 0.0 {
        return Ok(std::f64::consts::FRAC_PI_2);
    }
    let reciprocal = crate::ported::excel_numeric::excel_x87_recip(n);
    let angle = crate::ported::excel_numeric::excel_atan_reduced(reciprocal);
    let result = if n < 0.0 {
        angle + std::f64::consts::PI
    } else {
        angle
    };
    Ok(if result.abs() < f64::MIN_POSITIVE {
        0.0
    } else {
        result
    })
}

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

The recorded environments below distinguish a reading from a same-input comparison. Counts describe captured inputs in each environment; overlapping captures and comparisons are not totals of unique worksheet calls.

Excel 16.0 buildPlatform and CPUCaptured inputs
19929Windows, bitness not recorded, CPU not recorded45
20430Windows, 64-bit, CPU not recorded16,924
  • XC-ACOT-001: build 19929 versus build 20430; 2 same-input pairs, 0 differing answers. Compared axes: excel-build. Numeric answers were compared by their recorded binary64 bits; other answers by typed value.

Agreement on these compared inputs does not establish agreement on unmeasured inputs.

Recorded environments and comparison details.

Excel 16.0 build 19929

Windows, bitness not recorded, CPU not recorded

45 captured inputs are indexed for this environment. Capture dates are not recorded. This is a reading count, not a comparison with another build.

Excel 16.0 build 20430

Windows, 64-bit, CPU not recorded

16,924 captured inputs are indexed for this environment. Capture dates: 2026-09-29 to 2026-09-29. This is a reading count, not a comparison with another build.

Alternatives

Relationships

  • COT — the forward function. COT(ACOT(x)) = x to rounding; ACOT(COT(t)) recovers t only for t in (0, pi).
  • ACOTH — the hyperbolic namesake, and a genuinely different shape: its domain excludes [-1, 1] entirely, where ACOT accepts everything.
  • ACOS — shares the stated range 0 to pi, and shares nothing else. The discriminator is the domain: ACOS takes [-1, 1], ACOT takes all of R. Two surfaces with the same stated range are a live confusion, and this is the pair.
  • ATAN2 — the four-quadrant route. ACOT(x) is ATAN2(x, 1) in Excel's x-first argument order, and that formulation is better behaved at large |x| than the subtraction is.
  • Confused with: 1/ATAN(x), which is not any inverse cotangent; and ATAN(1/x), which is the other branch convention and differs by pi for negative arguments.

Named variants

No named variants are recorded yet.

Suggest a correction or contribute an implementation · For agents