Excel functions / Math

ATAN2 function

The angle, in radians, from the x-axis to the point (x, y). Unlike ATAN it knows which quarter of the circle the point is in.

Syntax

=ATAN2(x_num, y_num)

Arguments

When to use it

ATAN2 gives the angle, in radians, from the x-axis to the point (x, y), anywhere around the circle. It turns map coordinates into a bearing. Note that x comes first, unlike some other programs.

Examples

  1. The angle to the point (-1, 1)

    ABCD
    1xy
    2-11135

    In D2: =DEGREES(ATAN2(A2, B2)) → 135

    Try this example

  2. A point straight down

    ABCD
    1xy
    20-5-90

    In D2: =DEGREES(ATAN2(A2, B2)) → -90

    Try this example

Common mistakes

ATAN2 in other languages

Excel shows function names in its own language. In these languages it also puts a semicolon between arguments where English has a comma.

Translate a whole formula

Try ATAN2 in the playground

Related functions