
📎 This article includes 1 downloadable practice file ↓
In this article
ATAN2 returns the angle of a point, handling all four quadrants. Note Excel’s order is (x, y) — the reverse of many programming languages.
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
| x | y | Formula | Result |
|---|---|---|---|
| 1 | 1 | =ROUND(DEGREES(ATAN2(A2,B2)),1) | 45 |
| -1 | 1 | =ROUND(DEGREES(ATAN2(A3,B3)),1) | 135 |
| -1 | -1 | =ROUND(DEGREES(ATAN2(A4,B4)),1) | -135 |
Results calculated in Excel.
Mistakes people make
| Mistake | What to do instead |
|---|---|
| Argument order | Excel is ATAN2(x,y) — the reverse of most programming languages |
| Both zero | #DIV/0! |
Related functions
📚 Part of the free Excel course: Beginner → Expert · Try it in the Formula Lab or ask the AI Helper.
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.
Atul (AJ) builds office-automation and local-first AI tools as Atulya AI, and works with Excel, SAP and Oracle EPM every day. He writes about the shortcuts, macros and automations that actually save time — plus the occasional wacky fact. Videos on YouTube: Lazy Automator AI (@LazyAutomatorAI).
More posts by Atul →Build this skill next
This page is a quick function reference. Use it for syntax, then practise the function in a broader workflow.
Stuck on a step? Ask a question and the AI answers using this article.