{
  "category": "Engineering functions",
  "display_name": "IMAGINARY",
  "entry_kind": "built_in_function",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.IMAGINARY",
  "implementation_state": {
    "answer_bank": {
      "excel_builds": [
        "20430"
      ],
      "larger_numeric": 0,
      "last_bit": 0,
      "matched": 1209,
      "other_mismatch": 0,
      "refused": 0,
      "rows": 1209,
      "unread": 0,
      "worst_ulp": 0
    },
    "detail": "Recorded: 1,209 in the answer bank and 3 workbook cells.",
    "dnacalc_commit": "9e1884369a678158dd82d3d74188daf986995e87",
    "in_catalogue": true,
    "state": "matches",
    "state_label": "Matches every recorded Excel answer",
    "summary": "Matches all 1,212 recorded answers",
    "workbook_corpus": {
      "cells": 3,
      "matched": 3
    }
  },
  "implementations": [
    {
      "commit": "9e1884369a678158dd82d3d74188daf986995e87",
      "flavour": "excel-compatibility-candidate",
      "language": "Rust",
      "name": "CalcFunc",
      "own_code": [
        "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/engineering.rs#L188-L188"
      ],
      "repository": "https://github.com/DnaCalc/DnaCalc",
      "shared_code": [
        "catalogue/engineering::complex_of",
        "catalogue/engineering::complex_number",
        "ported/complex_family::parse_ascii_decimal_15",
        "ported/complex_family::ParsedComplex::new",
        "ported/complex_family::normalize_zero",
        "ported/complex_family::parse_real_number",
        "ported/complex_family::find_real_imag_split",
        "ported/complex_family::parse_imag_coeff",
        "ported/complex_family::parse_complex_text"
      ],
      "source": "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/engineering.rs#L188-L188",
      "state": "matches",
      "suite": null,
      "summary": "Matches all 1,212 recorded answers"
    }
  ],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.IMAGINARY.json",
  "name": "IMAGINARY",
  "notes": [],
  "schema": "efh.function-reference/v1",
  "section_order": [
    "what-it-does",
    "try-it",
    "quirks",
    "how-to-implement",
    "version-differences",
    "alternatives"
  ],
  "sections": {
    "alternatives": "\n[IMREAL](FUNC.IMREAL.md) extracts the real coefficient. [COMPLEX](FUNC.COMPLEX.md) assembles a pair, while [IMCONJUGATE](FUNC.IMCONJUGATE.md) changes the imaginary sign and returns complex text.\n\n\n",
    "how-to-implement": "\nAdmit 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.\n\nReturn 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.\n\n\n",
    "quirks": "\nA 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.\n\n\n",
    "sources": "\n- [Microsoft: IMAGINARY function](https://support.microsoft.com/en-us/excel/functions/imaginary-function), opened 6 November 2026; syntax, documented argument rules and errors.\n- [DnaCalc implementation](https://github.com/DnaCalc/DnaCalc/blob/da3ecc4fb19a3a5529708c311d0e8f05688ac165/crates/calc-func/src/ported/complex_family.rs); implementation steps and the limits identified in the text.\n\n",
    "try-it": "\n`=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.\n\n\n",
    "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.\n\n| Excel 16.0 build | Platform and CPU | Captured inputs |\n|---|---|---:|\n| 20430 | Windows, 64-bit, CPU not recorded | 1,209 |\n\nThe 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.\n\n[Recorded environments and comparison details](https://github.com/DnaCalc/ExcelFunctionsHandbook/blob/5dc75391aa5125ccc5abdb095da85950980d6fd8/content/evidence/environments/FUNC.IMAGINARY.json).",
    "what-it-does": "\n`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.\n\n\n"
  },
  "signature": {
    "display": "IMAGINARY(inumber)",
    "parameters": [
      {
        "description": null,
        "name": "inumber",
        "optional": false,
        "repeats": false
      }
    ],
    "trailing_repeats": false
  },
  "sources": {
    "metadata": {
      "admission": {
        "label": "implemented",
        "reason": null
      },
      "arity": {
        "max": 1,
        "min": 1
      },
      "category": "Engineering functions",
      "classification": {
        "arg_preparation_profile": "ValuesOnlyPreAdapter",
        "coercion_lift_profile": "Custom",
        "determinism_class": "Deterministic",
        "error_collapse_profile": "None",
        "fec_dependency_profile": "None",
        "host_interaction_class": "None",
        "kernel_signature_class": "Custom",
        "rich_value_usage": "RichBlind",
        "surface_fec_dependency_profile": "None",
        "thread_safety_class": "SafePure",
        "volatility_class": "NonVolatile"
      },
      "descriptions": {
        "long": null,
        "short": "Imaginary part of a complex number",
        "short_source": "dna-calc-own"
      },
      "docs": {
        "english_description": "Returns the imaginary coefficient of a complex number",
        "microsoft_url": "https://support.microsoft.com/en-us/office/imaginary-function-dd5952fd-473d-44d9-95a1-9a17b23e428a"
      },
      "entry_kind": "built_in_function",
      "localized_family_names": null,
      "localized_names": [],
      "signature": {
        "display": "IMAGINARY(inumber)",
        "parameters": [
          {
            "description": null,
            "name": "inumber",
            "optional": false,
            "repeats": false
          }
        ],
        "trailing_repeats": false
      },
      "surface_name": "IMAGINARY",
      "version_marker": null,
      "xlcall": {
        "code": "409",
        "symbol": "xlfImaginary"
      }
    },
    "microsoft": "https://support.microsoft.com/en-us/office/imaginary-function-dd5952fd-473d-44d9-95a1-9a17b23e428a"
  },
  "try_it": {
    "formula": "=IMAGINARY(\"2-3i\")"
  },
  "url": "https://handbook.dnacalc.com/functions/IMAGINARY.html",
  "variants": [],
  "versions": [
    {
      "behaviour": "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.",
      "excel_build": "16.0 build 20430",
      "platform": "Windows, 64-bit, CPU not recorded",
      "sources": [
        "https://github.com/DnaCalc/ExcelFunctionsHandbook/blob/5dc75391aa5125ccc5abdb095da85950980d6fd8/content/evidence/environments/FUNC.IMAGINARY.json"
      ]
    }
  ]
}