ATAN2 Function

Excel 2007+

Summary

The Excel ATAN2 function calculates the arctangent of a point's coordinates, returning the angle in radians from the positive x-axis to the line connecting the origin with the specified (x, y) point. Unlike regular ATAN, ATAN2 properly handles all quadrants and distinguishes between positive and negative angles.

Syntax

ATAN2(x_num, y_num)

Parameters

Parameter Type Required Description
x_num Number Yes The x-coordinate (horizontal distance from origin)
y_num Number Yes The y-coordinate (vertical distance from origin)

Using the ATAN2 Function

ATAN2 is essential for calculating angles in coordinate geometry, data visualization, engineering calculations, and graphics applications. It provides the precise angle measurement between the origin and any point on the Cartesian plane, correctly handling quadrant-specific directions that standard ATAN cannot.

Common ATAN2 Examples

Basic Quadrant I Angle

=ATAN2(1,1)

Returns π/4 radians (45°) for point (1,1) - first quadrant angle.

Quadrant III Angle

=ATAN2(-1,-1)

Returns -3π/4 radians (-135°) for point (-1,-1) - third quadrant.

Convert to Degrees

=DEGREES(ATAN2(-1,-1))

Converts -3π/4 radians to -135 degrees using DEGREES function.

Manual Degree Conversion

=ATAN2(-1,-1)*180/PI()

Same result as DEGREES, manually converting radians to degrees.

Frequently Asked Questions

ATAN2(x,y) uses both coordinates and handles all quadrants correctly, while ATAN(y/x) loses quadrant information and fails when x=0.

ATAN2 always returns radians. Use DEGREES(ATAN2()) or multiply by 180/PI() for degrees.

ATAN2 returns #DIV/0! error since no defined angle exists at the origin.

Common Errors and Solutions

#DIV/0! Error

Cause: Both x_num and y_num arguments are 0

Solution: Ensure at least one coordinate is non-zero

#VALUE! Error

Cause: Non-numeric arguments provided

Solution: Verify both x_num and y_num contain valid numbers

Notes

  • Positive results indicate counterclockwise rotation from x-axis
  • Negative results indicate clockwise rotation from x-axis
  • Range: -π to π radians (excluding -π)
  • Perfect for polar coordinate conversions
  • Use with MOD function for angle normalization

Compatibility

Available in: Excel 2007, Excel 2010, Excel 2013, Excel 2016, Excel 2019, Excel 2021, Microsoft 365

Not available in:

Content last reviewed: December 9, 2025
Update frequency: As needed
Excel versions tested: Excel 2007+