ATAN2
Returns the arctangent of the specified x and y coordinates, in radians, between -π and π. Unlike ATAN, it correctly resolves the quadrant from the sign of both arguments.
ATAN2(x_num, y_num)Arguments
x_numThe x-coordinate of the point.y_numThe y-coordinate of the point.
=ATAN2(1,1)π/4 (45°) — first quadrant
=ATAN2(-1,1)3π/4 (135°) — second quadrant
=DEGREES(ATAN2(1,1))Convert result to degrees
- •Returns #DIV/0! if both x_num and y_num are 0
- •Argument order is (x, y) — opposite of math convention atan2(y, x)
- •Use DEGREES() to convert the result from radians to degrees
- •Passing arguments in the wrong order - ATAN2 takes (x_num, y_num), the reverse of the mathematical convention atan2(y,x) used in many programming languages and textbooks, which can silently produce a wrong angle
- •Passing both x_num and y_num as 0, which returns a #DIV/0! error since the angle at the origin is undefined
- •Using plain ATAN instead of ATAN2 when the actual quadrant of a point matters - ATAN alone can't distinguish between angles that differ by 180°, since it only takes a single ratio, not separate x and y coordinates
ATANTakes a single ratio and can't determine the correct quadrant, unlike ATAN2 which uses separate x and y coordinates to resolve the angle unambiguously.DEGREESConverts ATAN2's radian result into degrees, a common step since ATAN2 always returns radians.TANPerforms the forward operation - calculates a tangent ratio from an angle, the inverse relationship to what ATAN2 computes.Why does ATAN2 give a different result than I expected compared to other software?
Excel's ATAN2 takes arguments as (x_num, y_num), while many other languages and math textbooks use atan2(y, x) - the reversed argument order is a common source of confusion when porting formulas.
Why does ATAN2 return a #DIV/0! error?
Both x_num and y_num are 0 - the angle at the origin point (0,0) is mathematically undefined, so Excel raises an error rather than guessing.
Why use ATAN2 instead of ATAN?
ATAN2 correctly determines which quadrant an angle falls in based on the signs of both x_num and y_num, while plain ATAN only works with a single ratio and can't distinguish between angles 180° apart.
Need to translate a formula using ATAN2?
Use our translator to convert your complete formula
