Excel
ATAN2 function in Excel
Returns the arctangent from x- and y-coordinates
=ATAN2(x_num, y_num)ATAN2 syntax and parameters
Two arguments, two required.
- x_numnumberRequired
The x-coordinate of the point.
- y_numnumberRequired
The y-coordinate of the point.
ATAN2 examples
Formulas you'll actually reuse.
The bearing of a point from x and y coordinates — ATAN2 keeps the quadrant:
=DEGREES(ATAN2(B2, C2))Result
135A compass-style 0–360° heading from two points (note x then y):
=MOD(DEGREES(ATAN2(C2 - C1, B2 - B1)), 360)Result
225
ATAN2 in Google Sheets
Same name — your formula ports as-is.
Try ATAN2 in the playground
Edit the example — nothing to install.
Preloaded with the ATAN2 formula from Example 1 — change anything and watch it respond.
Loading the editor…
ATAN2 errors
What they mean — and the fixes.
#DIV/0!Both coordinates are 0 — the angle is undefined at the origin.
Related functions
More ways Excel gets this done.
- ABSReturns the absolute value of a numberMathGoogle Sheets
- ACOSReturns the arccosine of a numberMathGoogle Sheets
- ACOSHReturns the inverse hyperbolic cosine of a numberMathGoogle Sheets
- ACOTReturns the arccotangent of a numberMathGoogle Sheets
- ACOTHReturns the hyperbolic arccotangent of a numberMathGoogle Sheets
- AGGREGATEReturns an aggregate in a list or databaseMathNo Google Sheets equivalent