ATAN2 Function in Excel: Angle From X and Y

ATAN2 Function in Excel: Angle From X and Y featured illustration

📎 This article includes 1 downloadable practice file ↓

⏱ 2 min readUpdated 5 October 2026

MathLevel: ExpertAvailable in: Excel 2007+

In this article
  1. Syntax
  2. Examples
  3. Example 1
  4. ATAN2 in practice
  5. Where you will use it
  6. Worked example
  7. Mistakes people make
  8. Related functions
  9. Continue learning

ATAN2 returns the angle of a point, handling all four quadrants. Note Excel’s order is (x, y) — the reverse of many programming languages.

Advertisement

Syntax

=ATAN2(x_num, y_num)
Argument What it means
x_num, y_num Coordinates.

Examples

Example 1

=DEGREES(ATAN2(B2, C2))

Compass-style bearing from east/north offsets.

ATAN2 in practice

Where you will use it

  • Bearing from x/y differences
  • Angle of a vector in any quadrant
  • Map and GPS calculations

Worked example

xyFormulaResult
11=ROUND(DEGREES(ATAN2(A2,B2)),1)45
-11=ROUND(DEGREES(ATAN2(A3,B3)),1)135
-1-1=ROUND(DEGREES(ATAN2(A4,B4)),1)-135

Results calculated in Excel.

Mistakes people make

MistakeWhat to do instead
Argument orderExcel is ATAN2(x,y) — the reverse of most programming languages
Both zero#DIV/0!

DEGREES · SIN

📚 Part of the free Excel course: Beginner → Expert · Try it in the Formula Lab or ask the AI Helper.

⚡ Interactive Practice Lab & Formula Tester:

Test formulas dynamically in our web formula laboratory or download the companion Excel workbook.

📎 Practice files for this article

  • 📗
    Practice workbook: Math & rounding24 tasks on realistic sales data — type your formula, the Check column turns green when it is right. Answers sheet included.
    ⬇ XLSX · 35 KB

Free to use for learning. Files with macros (.bas) are plain text — import them with Alt+F11 → File → Import File, and always test on a copy.

✨ Ask AI about this article

Stuck on a step? Ask a question and the AI answers using this article.

Free · AI can be wrong