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

ArgumentRequired?What it does
x_numYesThe x coordinate.
y_numYesThe 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))
ABC
1xyDegrees
21145
3-11135
4-1-1-135
=DEGREES(ATAN2(A2, B2)) Explain

Common mistakes

  • Both zero. ATAN2(0, 0) returns #DIV/0!.

Notes

Kyle Stott

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.