ATAN2 Function
Returns the angle in radians to a point given by its x and y coordinates.
Syntax
Parameters
| Parameter | Description | Required |
|---|---|---|
| x_num | The x-coordinate of the point. NOTE: Excel lists x first, the opposite of the common math atan2(y, x) convention. | Required |
| y_num | The y-coordinate of the point. | Required |
Basic Example
Angle to the point (1, 1)
=ATAN2(1, 1)The point (1,1) sits at 45°, which is π/4 radians. Note x_num=1 is given before y_num=1.
Advanced Examples
Example 1: Convert to degrees for a quadrant check
Find the compass-style angle of a vector.Wrap in DEGREES.
=DEGREES(ATAN2(1, 1))Example 2: Negative coordinates land in the third quadrant
Point (-1, -1).Both coordinates negative produce a negative angle.
=ATAN2(-1, -1)How ATAN2 Works
ATAN2(x_num, y_num) returns the angle θ (in radians, from -π to π) between the positive x-axis and the line from the origin to (x_num, y_num). It uses the signs of both coordinates to place the result in the correct quadrant, avoiding the division-by-zero problem of ATAN(y/x). In Excel the first argument is x_num and the second is y_num.
Important Notes & Limitations
Both coordinates cannot be zero; ATAN2(0, 0) returns #DIV/0!.
The result is in radians from -π to π.
Excel's argument order is (x_num, y_num) — the reverse of the common mathematical atan2(y, x) — which is a frequent source of sign errors.
Common Errors & Fixes
#DIV/0!Both x_num and y_num are 0.Fix: Ensure at least one coordinate is non-zero.
Wrong quadrant angleArguments swapped (y before x) by mistake.Fix: Remember Excel expects x_num first, then y_num.
Download Practice File
ATAN2
atan2Practice ATAN2 with Real Data
Download a sample CSV file with pre-populated data and practice exercises for the ATAN2 function. Works in both Excel and Google Sheets.
File format: CSV (comma-separated values) - opens in Excel, Google Sheets, and all spreadsheet apps