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)| Argument | What it means | |
|---|---|---|
number | Required | The 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
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Roof | Rise (m) | Run (m) | |
| 2 | Garage | 2.4 | 4.2 | 29.74 |
Result: 29.74
tan⁻¹(0.571) ≈ 29.74° (2 decimals).
2Road gradient in degrees
| A | B | C | |
|---|---|---|---|
| 1 | Road | Gradient | |
| 2 | Mountain pass | 0.08 | 4.57 |
Result: 4.57
An 8% gradient (B2 formatted as %) is only about 4.57°, which surprises many people (2 decimals).
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
Wrong quadrant | Using 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.
| Language | Function name |
|---|---|
| Czech | ARCTG |
| Danish | ARCTAN |
| Dutch | BOOGTAN |
| German | ARCTAN |
| Hungarian | ARCTAN |
| Italian | ARCTAN |
| Norwegian (Bokmål) | ARCTAN |
| Swedish | ARCTAN |