ATAN2 Function
Returns the angle of a point (x, y) from the x-axis.
Category
Math & Trig
Available in
All versions, Microsoft 365
Returns
An angle in radians
Want to practice ATAN2 in a real spreadsheet? Open a blank sheet in our Practice Sandbox and try it with live data, with the AI Excel tutor beside you. No Excel needed — just a free account.Try it free in the Sandbox
Overview
ATAN2 takes x and y coordinates and returns the angle from the positive x-axis, between −π and π — it knows which quadrant the point is in.
Note Excel's order: x first, then y (many programming languages use y, x).
Syntax
=ATAN2(x_num, y_num) Explain
Arguments
| Argument | Required? | What it does |
|---|---|---|
| x_num | Yes | The x coordinate. |
| y_num | Yes | The y coordinate. |
Examples
Example 1 — Bearing to a point
Angle in degrees from the x-axis to each delivery point.
C2fx=DEGREES(ATAN2(A2, B2))
| A | B | C | |
|---|---|---|---|
| 1 | x | y | Degrees |
| 2 | 1 | 1 | 45 |
| 3 | -1 | 1 | 135 |
| 4 | -1 | -1 | -135 |
=DEGREES(ATAN2(A2, B2)) Explain
Common mistakes
- Both zero. ATAN2(0, 0) returns #DIV/0!.
Notes

Author
Kyle Stott
Certified Microsoft Excel Expert
Kyle has worked professionally with Microsoft Excel for over a decade and has consulted on and taught Excel best practices to over 400 companies across 30+ countries.