Math & trig function

COT function

Returns the cotangent of an angle in radians (1 / tangent), e.g. horizontal run per unit of rise.

Available in Excel 2013 and later, Microsoft 365, Excel for the web, Excel for Mac 2016 and later

Excel 2013 and laterWorks in Google Sheets

Syntax

COT(number)
ArgumentWhat it means
numberRequiredThe angle in radians; its absolute value must be less than 2^27.

Returns: cos ÷ sin of the angle.

How COT works

The cotangent is the reciprocal of the tangent: adjacent side divided by opposite side. In practical terms it is the horizontal run for every unit of height. Given the height of a slope and its angle, height*COT(angle) gives the horizontal distance needed, which is useful for ramps, embankments, stairs and the length of a shadow cast by a pole at a given sun angle.

COT(0) is undefined and returns #DIV/0!. Arguments of 2^27 or more return #NUM!. Before Excel 2013, write 1/TAN(x). Excel's trigonometric functions work in radians, not degrees. Convert an angle with RADIANS (or multiply by PI()/180) before passing it in, and convert results back with DEGREES.

Examples

1Length of a shadow

D2fx=B2*COT(RADIANS(C2))
ABCD
1ObjectHeight (m)Sun elevation (°)
2Lamp post62512.87

Result: 12.87

With the sun 25° above the horizon, a 6 m post casts a shadow of about 12.87 m (2 decimals).

2Cotangent of zero

A1fx=COT(0)
A
1#DIV/0!

Result: #DIV/0!

tan(0) = 0, so its reciprocal does not exist.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 13 KB

Common errors and how to fix them

ErrorWhy it happensFix
#DIV/0!The angle is 0 (or a multiple of π).Check the angle.
#NUM!|number| ≥ 2^27.Reduce the angle.

Tips

  • Horizontal space needed for a ramp: =rise*COT(RADIANS(max_angle)).

Google Sheets

COT also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.