Contact

ONLYOFFICE ATAN2 Function: X/Y Order, Quadrants, Angles and Examples

Mathematical Intermediate ONLYOFFICE Spreadsheet Editor

Use ONLYOFFICE ATAN2 with x before y to calculate mathematical direction angles, handle all four quadrants and avoid coordinate-order mistakes.

Verification status: Official documentation referenced; example outcomes independently reasoned or arithmetically checked where stated. Not executed in ONLYOFFICE Spreadsheet Editor. How formula examples are checked

Quick answer: x coordinate first, y coordinate second

The official English formula is =ATAN2(x_num, y_num), not ATAN2(y_num,x_num). For a point with x=3 and y=4, the formula =ROUND(DEGREES(ATAN2(3,4)),6) has an independently calculated mathematical expectation of 53.130102°. Reversing the coordinates to ATAN2(4,3) changes the expected result to 36.869898°. Neither result was run in native ONLYOFFICE.

Use ATAN2 to calculate a coordinate-aware angle for a point/vector relative to the positive x axis, for example the direction from one xy location to another. Unlike the one-ratio ATAN function, the mathematical ATAN2 operation preserves the signs of both x and y and distinguishes quadrants. The standard mathematical signed principal-angle interval is (−180°, 180°] degrees or (−π,Ï€] radians, but ONLYOFFICE’s brief function article does not explicitly document this return interval, axis endpoints or the exact origin error. The expected values below use the standard mathematical ATAN2 convention; native vendor behaviour still requires validation.

Official syntax, arguments, order and defaults

=ATAN2(x_num, y_num)
Position Name Required? Official description Default
1 x_num Yes x coordinate, a numeric value or referenced cell None
2 y_num Yes y coordinate, a numeric value or referenced cell None

Order matters: x is the first argument and y the second; both are documented as required numeric coordinates. Neither is an optional default.

Exactly what is documented: the two ordered coordinate arguments are described in the ONLYOFFICE ATAN2 Help Center entry (accessed 2026-10-13 UTC). No optional arguments or defaults are specified for this function. Numbers may be directly typed or supplied by referenced cells. The documentation does not provide a full table of behaviour for blank references, quoted numeric strings, Booleans, arrays, worksheet error propagation or a first-introduced version; those areas require native checking. The x/y argument order is explicitly stated by the vendor. This is the opposite ordering to the positional parameters of Python math.atan2(y, x); Python is used here only to compute independent expected values.

Versions, platforms and formula language

The named function is present in the current official Spreadsheet Editor function catalogue and the function-specific article, both checked on 2026-10-13 UTC. This is documentation confirmation, not a claim of successful calculation in any installed build. The function article is not tagged with a minimum Docs web, self-hosted Docs, or Desktop Editors release. The separate Docs changelog and Desktop Editors changelog were consulted, but no first-supported-version or complete cross-platform parity statement for ATAN2 was established. The official page does not state whether (0,0) returns a particular spreadsheet error code in any specified build; exclude that point from positive worked examples until native-tested. No native Desktop/web application or screenshot testing was available.

These formulas show the English-language function name, decimal point and comma delimiter (where more than one argument exists). ONLYOFFICE’s Advanced Settings has distinct Formula Language and Region selectors and configurable decimal/thousands separators; it does not validate any particular translated name or argument separator in this research. Check the Formula Language setting and tooltips before pasting formulas on another locale or a different editor release. The official function entry guide explains the Home and Formula insert menus, Shift+F3, equal sign, parentheses and comma-separated arguments for its English examples.

Evidence labels throughout: A statement called official-documentation checked is drawn from the linked ONLYOFFICE page; a displayed number called independently calculated was computed from the mathematical definition using Python’s math library and then rounded for readability; native ONLYOFFICE observed results: none. Correct-looking expected values do not prove the installed program has calculated them.

Reproducible xy worksheet (all four quadrants)

  1. Create a blank sheet and enter x in A1, y in B1, Angle (radians) in C1, and Degrees, 6dp in D1.
  2. Enter the exact x/y integers below into columns A and B. Do not put y in column A.
  3. Put =ATAN2(A2,B2) in C2, and =ROUND(DEGREES(C2),6) in D2. Fill C2:D2 down to row 12. Column D can also directly use =ROUND(DEGREES(ATAN2(A2,B2)),6).
  4. Compare the output against these independent mathematical expectations, not vendor-observed native results. Each standard mathematical angle is measured counterclockwise from the positive x axis, with negative results clockwise.
Row A: x B: y Equivalent formula in D Expected degrees (6dp)
2 1 1 =ROUND(DEGREES(ATAN2(A2,B2)),6) 45
3 3 4 =ROUND(DEGREES(ATAN2(A3,B3)),6) 53.130102
4 -1 1 =ROUND(DEGREES(ATAN2(A4,B4)),6) 135
5 -3 4 =ROUND(DEGREES(ATAN2(A5,B5)),6) 126.869898
6 -1 -1 =ROUND(DEGREES(ATAN2(A6,B6)),6) -135
7 1 -1 =ROUND(DEGREES(ATAN2(A7,B7)),6) -45
8 0 5 =ROUND(DEGREES(ATAN2(A8,B8)),6) 90
9 0 -5 =ROUND(DEGREES(ATAN2(A9,B9)),6) -90
10 5 0 =ROUND(DEGREES(ATAN2(A10,B10)),6) 0
11 3 -4 =ROUND(DEGREES(ATAN2(A11,B11)),6) -53.130102
12 -3 -4 =ROUND(DEGREES(ATAN2(A12,B12)),6) -126.869898

Independent calculation method: for each ordered point (x,y), expected radian angle was computed as math.atan2(y,x) in Python. That language’s positional order is (y,x), while ONLYOFFICE’s documented formula positions are (x_num,y_num)—the reversal is deliberate. This independent mathematical check does not prove ONLYOFFICE’s floating-point branch boundary or version support.

Additional fully specified formulas

Case Enter in an empty cell (English formula syntax) Independently expected result
North-east point x=3, y=4 =ROUND(DEGREES(ATAN2(3,4)),6) 53.130102
Swapped coordinate order x=4, y=3 =ROUND(DEGREES(ATAN2(4,3)),6) 36.869898
Quadrant II x=-3, y=4 =ROUND(DEGREES(ATAN2(-3,4)),6) 126.869898
Quadrant III x=-3, y=-4 =ROUND(DEGREES(ATAN2(-3,-4)),6) -126.869898
Quadrant IV x=3, y=-4 =ROUND(DEGREES(ATAN2(3,-4)),6) -53.130102
Negative-y axis =ROUND(DEGREES(ATAN2(0,-5)),6) -90
Normalize third-quadrant angle into [0°,360°) =ROUND(MOD(DEGREES(ATAN2(-1,-1))+360,360),6) 225
Normalize fourth-quadrant angle into [0°,360°) =ROUND(MOD(DEGREES(ATAN2(3,-4))+360,360),6) 306.869898
Shift coordinate origin: Δx=-2, Δy=5 =ROUND(DEGREES(ATAN2(4-6,9-4)),6) 111.801409
Mathematical radians for x=1, y=1 =ROUND(ATAN2(1,1),6) 0.785398

Advanced applications and coordinate pitfalls

Determine the direction from one point to another

Suppose a start location is at (6,4) and the end location is (4,9). The displacement is Δx = 4−6 = −2 and Δy = 9−4 = 5. Enter =ROUND(DEGREES(ATAN2(4-6,9-4)),6). The independently calculated mathematical angle is 111.801409° in quadrant II. Do not plug absolute coordinates into ATAN2 when the direction sought is from a different origin; subtract the start values first.

Keep all four quadrant signs

For a point (−3,4), DEGREES(ATAN2(-3,4)) has expected result approximately 126.869898°, not the negative acute angle that a naive ATAN(4/-3) would give. Likewise (−3,−4) has expected result -126.869898°, preserving its third-quadrant signed angle. The common formula ATAN(y/x) also divides by zero on the y-axis, whereas mathematical ATAN2 can handle x=0 when y≠0. Test this in your ONLYOFFICE release before relying on it for a critical workflow.

Express a signed mathematical angle on a 0°–360° scale

With a negative principal angle, =ROUND(MOD(DEGREES(ATAN2(-1,-1))+360,360),6) has expected value 225 degrees. The operation adds 360 before applying modulo 360 so it keeps only one revolution in [0,360). MOD is a separate spreadsheet operation; the output here is a mathematical expectation, and exact ONLYOFFICE normalization under different settings was not natively tested. For geographic compass bearings measured clockwise from north, further axis conversion is needed; do not silently label this x-axis mathematical angle as a compass bearing.

Axis and undefined origin

The point (0,5) is expected 90° and (0,−5) expected −90° in the mathematical model. Both coordinates zero means the vector length is zero and its direction has no mathematical meaning. Unlike Excel’s separately documented error code, the short ONLYOFFICE ATAN2 page does not state the exact native error or fallback for ATAN2(0,0). There is deliberately no claimed expected native error code for the origin.

Python and spreadsheet library argument-order trap

If you are checking a worksheet result with a Python script, call math.atan2(y,x) in Python. For x=3 and y=4, that is math.atan2(4,3); the ONLYOFFICE formula remains ATAN2(3,4). Copying the Python call verbatim into a spreadsheet would swap axes and return the wrong expected angle.

Errors, limitations and troubleshooting

  • Swapped x and y: x is the first ONLYOFFICE argument. Check x/y column headings and formula reference positions if the angle looks wrong.
  • Using ATAN instead of ATAN2: ATAN(y/x) loses quadrant information when both signs change and may divide by zero when x=0.
  • (0,0): there is no mathematical direction. Do not assert Excel’s #DIV/0! as the verified ONLYOFFICE output; native testing is pending.
  • Signed versus full-circle degrees: −135° represents the same direction as 225° mathematically, but different range conventions. Normalize only after specifying the desired range.
  • Radian versus degree output: the angle calculated by the mathematical ATAN2 definition is in radians; the workbook examples use DEGREES for readable degrees. The short vendor article doesn’t specify the actual range, so test if important.
  • Rounding around the negative x axis: a branch cut occurs near ±180°. Results for points exactly on the axis, signed zero and near-zero values can depend on the implementation’s convention; the vendor help article does not specify all endpoints.
  • Non-numeric or blank coordinate: the vendor article calls for numeric values but does not document a complete coercion/error matrix; test actual edition to learn precise messages.
  • Locale, region and formula parsing: only English formula syntax was checked; match the actual formula language and separators before importing.
  • Unexpected error after typing: confirm = prefix, parentheses, required two arguments and no missing coordinate cells; then test the smallest reference point (1,1).

Cross-compatibility: separate vendor evidence

Microsoft officially documents Excel’s ATAN2(x_num,y_num) in the same x-then-y argument order, and separately documents Excel’s origin error. This is evidence for Excel only. It is not proof of ONLYOFFICE’s origin error, floating-point branch cut, supported editions, arrays or regional syntax. Python math.atan2(y,x) intentionally has the reverse positional argument order. Other spreadsheet suites were not natively compared. Test a representative four-quadrant matrix in each target application when sharing critical coordinate files.

Official sources and claim-level evidence (2026-10-13 UTC)

  1. Canonical function and exact two-argument syntax/order, numerical coordinate definitions: ONLYOFFICE ATAN2, accessed 2026-10-13 UTC. Its article does not establish first-supported version, origin-specific error or complete branch conventions.
  2. One-ratio ATAN contrast: ONLYOFFICE ATAN, accessed 2026-10-13 UTC.
  3. Degrees conversion: ONLYOFFICE DEGREES, accessed 2026-10-13 UTC.
  4. English function entry, catalogue and separator guidance: ONLYOFFICE Insert Function, accessed 2026-10-13 UTC.
  5. Formula language and regional settings: ONLYOFFICE Advanced Settings, accessed 2026-10-13 UTC.
  6. Distinct Docs/web versus Desktop release trails: Docs changelog and Desktop changelog, accessed 2026-10-13 UTC. They were not used to invent minimum release support.
  7. Comparative Microsoft-only details, not ONLYOFFICE evidence: Excel ATAN2, accessed 2026-10-13 UTC.