Math & trig function

ATAN function

Returns the arctangent (inverse tangent) in radians: the angle whose tangent is the given number.

Available in All versions of Excel, Excel for the web, Excel for Mac

In every Excel versionWorks in Google Sheets

Syntax

ATAN(number)
ArgumentWhat it means
numberRequiredThe tangent of the angle, e.g. rise / run.

Returns: An angle in radians from −π/2 to π/2.

How ATAN works

ATAN turns a slope into an angle. Divide the rise by the run (a roof rising 2.4 m over 4.2 m, a road climbing 8 m every 100 m) and DEGREES(ATAN(ratio)) gives the angle in degrees. It accepts any number, so unlike ASIN and ACOS it never returns #NUM!.

The result is between −90° and 90°, which means ATAN cannot tell the difference between directions in opposite quadrants: (2, 2) and (−2, −2) have the same ratio. When you have separate x and y values and need a full 360° direction, use ATAN2.

Examples

1Roof pitch from rise and run

D2fx=DEGREES(ATAN(B2/C2))
ABCD
1RoofRise (m)Run (m)
2Garage2.44.229.74

Result: 29.74

tan⁻¹(0.571) ≈ 29.74° (2 decimals).

2Road gradient in degrees

C2fx=DEGREES(ATAN(B2))
ABC
1RoadGradient
2Mountain pass0.084.57

Result: 4.57

An 8% gradient (B2 formatted as %) is only about 4.57°, which surprises many people (2 decimals).

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

Common errors and how to fix them

ErrorWhy it happensFix
Wrong quadrantUsing ATAN(y/x) when x is negative gives an angle 180° off.Use ATAN2(x, y).
#DIV/0!Calculating y/x with x = 0 before ATAN.Use ATAN2, which handles x = 0.

Tips

  • Percent slope to degrees: =DEGREES(ATAN(slope%)); degrees to slope: =TAN(RADIANS(deg)).

Google Sheets

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

ATAN in other languages

In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.

LanguageFunction name
CzechARCTG
DanishARCTAN
DutchBOOGTAN
GermanARCTAN
HungarianARCTAN
ItalianARCTAN
Norwegian (Bokmål)ARCTAN
SwedishARCTAN