ATAN2
Quirk foundCategory: Math and trigonometry · Last tested 2026-09-01
Real compatibility results for the ATAN2 function: executed in Excel for the web, Google Sheets and LibreOffice Calc, with desktop Excel behavior from Microsoft’s official documentation (we do not run desktop Excel — Excel for the web is a different application and is executed separately). Syntax and links to that documentation are below.
Support matrix
| Engine | Documented | Live-tested | Verdict |
|---|---|---|---|
| Excel (desktop) | Yes | No — documented only | n/a |
| Excel for the web | — | Yes (recalc, 2026-09-01) | Supported, behaves as documented |
| Google Sheets | Yes | Yes (Drive import, 2026-08-31) | Supported, behaves as documented |
| LibreOffice Calc | Yes | Yes (25.8.7.3, 2026-08-31) | Quirk found |
LibreOffice version history
We executed the same test cases under each LibreOffice release to show exactly when ATAN2’s support changed — not documentation claims, real results.
| LibreOffice version | Verdict | Tested |
|---|---|---|
| 24.2.0.3 | Quirk found | 2026-08-31 |
| 24.8.7.2 | Quirk found | 2026-08-31 |
| 25.2.0.3 | Quirk found | 2026-08-31 |
| 25.8.7.3 | Quirk found | 2026-08-31 |
Why isn't ATAN2 working in LibreOffice?
ATAN2 exists in LibreOffice 25.8.7.3, but it is not a drop-in match for
Excel — our executed tests found real behavioral differences (detailed in the test results on this
page). If a formula that works in Excel or Google Sheets misbehaves in LibreOffice, compare your usage
against the failing cases above before assuming your data is wrong.
Discovered quirks
-
=ATAN2(0,0) on
LibreOffice Calc returned
0, but the documented/expected
result is #DIV/0!.
Provenance
Excel documents: "If both x_num and y_num are 0, ATAN2 returns the #DIV/0! error value." Note this is #DIV/0!, not the #NUM! that most out-of-domain math arguments produce; MISMATCH vs expected: expected '#DIV/0!', got 0
Executed test cases
Excel for the web (executed 2026-09-01 via OneDrive recalculation)
These values come from Excel for the web, not from desktop Excel. They are two different implementations of the calculation engine, and this run measured only the web one: the corpus was uploaded to OneDrive as .xlsx, recalculated by Excel for the web on open, and downloaded again for readback. Excel for the web is a rolling service with no pinnable version, so the run is identified by its date. Where a value here disagrees with the Expected column — which is Microsoft’s documentation of the desktop product — we cannot tell you whether the web engine diverges from the desktop one or the documentation is wrong about both, because we do not run desktop Excel.
| Formula | Description | Result | Expected | Verdict |
|---|---|---|---|---|
| =ROUND(ATAN2(1,1),9) | Microsoft's documented worked example: arctangent of the point (1,1), which is pi/4 | 0.785398163 | 0.785398163ProvenanceMicrosoft's page publishes this example's result as 0.785398163. Independently verified in Python: Excel's argument order is ATAN2(x_num, y_num), so this is math.atan2(1, 1) = 0.7853981633974483 = pi/4 -> 0.785398163 at 9 dp |
Matched |
| =ROUND(ATAN2(-1,-1),8) | Microsoft's documented worked example: arctangent of the point (-1,-1), which is -3*pi/4 | -2.35619449 | -2.35619449ProvenanceMicrosoft's page publishes this example's result as -2.35619449. Independently verified: math.atan2(-1, -1) = -2.356194490192345 = -3*pi/4 -> -2.35619449 at 8 dp. This case also pins the documented argument ORDER: a function taking (y, x) instead would still return -3*pi/4 here, but the first-quadrant and x=0 cases below separate the two conventions |
Matched |
| =ROUND(DEGREES(ATAN2(-1,-1)),9) | The same example converted to degrees with the DEGREES function, as the page's fourth example does | -135 | -135.0ProvenanceMicrosoft's page publishes this example's result as -135. Independently verified: -3*pi/4 radians = -135 degrees exactly |
Matched |
| =ROUND(ATAN2(0,1),9) | An x-coordinate of zero, which the documentation explicitly allows | 1.570796327 | 1.570796327ProvenanceExcel documents "ATAN2(a,b) equals ATAN(b/a), except that a can equal 0 in ATAN2". With x_num = 0 and y_num = 1 the point is straight up the y-axis, so the angle from the x-axis is pi/2. Independently verified: math.atan2(1, 0) = 1.5707963267948966 -> 1.570796327 at 9 dp |
Matched |
| =ATAN2(0,0) | Both coordinates zero, which has no defined angle | #DIV/0! | #DIV/0!ProvenanceExcel documents: "If both x_num and y_num are 0, ATAN2 returns the #DIV/0! error value." Note this is #DIV/0!, not the #NUM! that most out-of-domain math arguments produce |
Matched |
Google Sheets (executed 2026-08-31 via Drive import)
Google Sheets is a rolling service with no pinnable version, so this run is identified by its date. The corpus was imported to Drive as .xlsx, recalculated by Sheets, and exported back for readback.
| Formula | Description | Result | Expected | Verdict |
|---|---|---|---|---|
| =ROUND(ATAN2(1,1),9) | Microsoft's documented worked example: arctangent of the point (1,1), which is pi/4 | 0.785398163 | 0.785398163ProvenanceMicrosoft's page publishes this example's result as 0.785398163. Independently verified in Python: Excel's argument order is ATAN2(x_num, y_num), so this is math.atan2(1, 1) = 0.7853981633974483 = pi/4 -> 0.785398163 at 9 dp |
Matched |
| =ROUND(ATAN2(-1,-1),8) | Microsoft's documented worked example: arctangent of the point (-1,-1), which is -3*pi/4 | -2.35619449 | -2.35619449ProvenanceMicrosoft's page publishes this example's result as -2.35619449. Independently verified: math.atan2(-1, -1) = -2.356194490192345 = -3*pi/4 -> -2.35619449 at 8 dp. This case also pins the documented argument ORDER: a function taking (y, x) instead would still return -3*pi/4 here, but the first-quadrant and x=0 cases below separate the two conventions |
Matched |
| =ROUND(DEGREES(ATAN2(-1,-1)),9) | The same example converted to degrees with the DEGREES function, as the page's fourth example does | -135 | -135.0ProvenanceMicrosoft's page publishes this example's result as -135. Independently verified: -3*pi/4 radians = -135 degrees exactly |
Matched |
| =ROUND(ATAN2(0,1),9) | An x-coordinate of zero, which the documentation explicitly allows | 1.570796327 | 1.570796327ProvenanceExcel documents "ATAN2(a,b) equals ATAN(b/a), except that a can equal 0 in ATAN2". With x_num = 0 and y_num = 1 the point is straight up the y-axis, so the angle from the x-axis is pi/2. Independently verified: math.atan2(1, 0) = 1.5707963267948966 -> 1.570796327 at 9 dp |
Matched |
| =ATAN2(0,0) | Both coordinates zero, which has no defined angle | #DIV/0! | #DIV/0!ProvenanceExcel documents: "If both x_num and y_num are 0, ATAN2 returns the #DIV/0! error value." Note this is #DIV/0!, not the #NUM! that most out-of-domain math arguments produce |
Matched |
LibreOffice Calc 25.8.7.3 (tested 2026-08-31)
| Formula | Description | Result | Expected | Verdict |
|---|---|---|---|---|
| =ROUND(ATAN2(1,1),9) | Microsoft's documented worked example: arctangent of the point (1,1), which is pi/4 | 0.785398163 | 0.785398163ProvenanceMicrosoft's page publishes this example's result as 0.785398163. Independently verified in Python: Excel's argument order is ATAN2(x_num, y_num), so this is math.atan2(1, 1) = 0.7853981633974483 = pi/4 -> 0.785398163 at 9 dp |
Matched |
| =ROUND(ATAN2(-1,-1),8) | Microsoft's documented worked example: arctangent of the point (-1,-1), which is -3*pi/4 | -2.35619449 | -2.35619449ProvenanceMicrosoft's page publishes this example's result as -2.35619449. Independently verified: math.atan2(-1, -1) = -2.356194490192345 = -3*pi/4 -> -2.35619449 at 8 dp. This case also pins the documented argument ORDER: a function taking (y, x) instead would still return -3*pi/4 here, but the first-quadrant and x=0 cases below separate the two conventions |
Matched |
| =ROUND(DEGREES(ATAN2(-1,-1)),9) | The same example converted to degrees with the DEGREES function, as the page's fourth example does | -135 | -135.0ProvenanceMicrosoft's page publishes this example's result as -135. Independently verified: -3*pi/4 radians = -135 degrees exactly |
Matched |
| =ROUND(ATAN2(0,1),9) | An x-coordinate of zero, which the documentation explicitly allows | 1.570796327 | 1.570796327ProvenanceExcel documents "ATAN2(a,b) equals ATAN(b/a), except that a can equal 0 in ATAN2". With x_num = 0 and y_num = 1 the point is straight up the y-axis, so the angle from the x-axis is pi/2. Independently verified: math.atan2(1, 0) = 1.5707963267948966 -> 1.570796327 at 9 dp |
Matched |
| =ATAN2(0,0) | Both coordinates zero, which has no defined angle | 0 | #DIV/0!ProvenanceExcel documents: "If both x_num and y_num are 0, ATAN2 returns the #DIV/0! error value." Note this is #DIV/0!, not the #NUM! that most out-of-domain math arguments produce |
Mismatch |
Docs & syntax
- Excel (desktop): official documentation
- Google Sheets: official documentation
- LibreOffice Calc: official documentation
Where ATAN2 behaves differently
- ACOT of a negative number is off by pi in Google Sheets versus Excel and LibreOffice
Executed evidence: =ROUND(ACOT(-2),9) is -0.463647609 in Google Sheets but 2.677945045 in Excel for the web and in all four LibreOffice builds. The two branches differ by exactly pi, 180 degrees, with no error anywhere. Dates, per-engine provenance and the portable fix. - ATAN2(0,0) is #DIV/0! in Excel but returns 0 in LibreOffice
ATAN2 of the origin has no defined angle: Excel documents #DIV/0! and Google Sheets returns it too, but LibreOffice (all four builds, executed) silently returns 0. Why the convention differs and how to guard the formula.