Formualizer Docs

IMARGUMENT

Returns the argument (angle in radians) of a complex number.

The angle is measured from the positive real axis.

The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.

Syntax

=IMARGUMENT(inumber)

Arguments

ArgumentTypeRequiredDefault
inumberanyRequired—

How it works

The principal angle of z = a + bi is atan2(b, a) in radians. Zero has no direction.

Remarks

  • Inputs are coerced to complex-number text before parsing.

Error cases

  • Returns #DIV/0! for 0+0i, where the angle is undefined.
  • Invalid complex text returns #NUM!.

Examples

Find the first-quadrant angle of 3 + 4i.

Formula =IMARGUMENT("3+4i")

Expected result 0.927295218001612

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Reflect the vector into the fourth quadrant to get a negative angle.

Formula =IMARGUMENT("3-4j")

Expected result -0.927295218001612

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

The positive real axis has angle zero.

Formula =IMARGUMENT("1")

Expected result 0

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

The text “invalid” has no complex value from which to find the argument.

Formula =IMARGUMENT("invalid")

Expected result #NUM!

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

First-quadrant angle

Formula =IMARGUMENT("1+i")

Expected result 0.785398163397448

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Negative real axis

Formula =IMARGUMENT("-1")

Expected result 3.14159265358979

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

FAQ

Why does IMARGUMENT(0) return #DIV/0!?

The argument (angle) of 0+0i is undefined, so the function returns #DIV/0!.

Implementation

Engine source

On this page