Engineering functions

IMAGINARY

Matches all 1,212 recorded answers

Recorded: 1,209 in the answer bank and 3 workbook cells. How we measure this · See the Rust code

No local names are recorded for this entry.

What it does

IMAGINARY(inumber)

IMAGINARY(inumber) returns the imaginary coefficient of a complex number a+bi. Unlike functions that return complex text, this function returns a real worksheet number.

Try it

Input cells (optional)

Example: {"B2": 3, "B3": 4}. A1 holds the formula. Other cells need values before a formula can read them.

Enter a formula, then calculate.

Runs locally in your browser with OneCalc. Its answer may differ from Excel. Use English function names and commas between arguments.

=IMAGINARY("2-3i") returns -3; =IMAGINARY("-j") returns -1. A real-only input such as =IMAGINARY(7) returns zero. The answer is the signed coefficient, without its suffix.

Quirks

A pure imaginary unit has an implicit coefficient of one; -i and -j have coefficient minus one. A real-only input has coefficient zero. The current parser rejects malformed text with #NUM! and the wrapper rejects logical values with #VALUE!. Fifteen-leading-digit text conversion is separate from the numeric result, so long coefficient strings need their own parsing tests.

How to implement

Admit a numeric scalar as (value,0). For text, recognize lowercase i or j, locate the component separator without splitting an exponent sign, and parse the two decimal coefficients. An absent real part means zero; a suffix with no magnitude means one, with its written sign.

Return the imaginary coefficient as a numeric value. For 2-3i, the parsed pair is (2,-3) and the output is minus three. For -j, the pair is (0,-1). No multiplication, modulus or complex-text formatting is needed after parsing. Use the source parser's fifteen-leading-digit conversion when reproducing its text route, rather than silently admitting the full precision of a different language parser.

Rust code

Show the CalcFunc source of this function

Quoted from the public repository DnaCalc/DnaCalc, crates calc-func and calc-fml, at commit 9e1884369a67. Comments are the source's own. A kernel shared with other functions appears once, on its module page.

IMAGINARY · 1 lines · calc-func/src/catalogue/engineering.rs on GitHub
32 imaginary "IMAGINARY" (1, 1) [V "inumber"] |s, a, sv| { complex_number(s, a, |z| Ok(z.im)) }

Kernels shared with other functions

Argument and result plumbing

No implementation has been published with a Handbook test suite for this function.

Version differences

The recorded environments below distinguish a reading from a same-input comparison. Counts describe captured inputs in each environment; overlapping captures and comparisons are not totals of unique worksheet calls.

Excel 16.0 buildPlatform and CPUCaptured inputs
20430Windows, 64-bit, CPU not recorded1,209

The record contains no same-input comparison between these environments. Reading different inputs on different builds does not establish either a version change or cross-build agreement.

Recorded environments and comparison details.

Excel 16.0 build 20430

Windows, 64-bit, CPU not recorded

1,209 captured inputs are indexed for this environment. Capture dates: 2026-09-29 to 2026-09-29. This is a reading count, not a comparison with another build.

Alternatives

IMREAL extracts the real coefficient. COMPLEX assembles a pair, while IMCONJUGATE changes the imaginary sign and returns complex text.

Named variants

No named variants are recorded yet.

Suggest a correction or contribute an implementation · For agents