{
  "category": "Logical functions",
  "display_name": "IFNA",
  "entry_kind": "built_in_function",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.IFNA",
  "implementation_state": {
    "answer_bank": null,
    "detail": "Recorded: 36 workbook cells.",
    "dnacalc_commit": "9e1884369a678158dd82d3d74188daf986995e87",
    "in_catalogue": true,
    "state": "matches",
    "state_label": "Matches every recorded Excel answer",
    "summary": "Matches all 36 recorded answers",
    "workbook_corpus": {
      "cells": 36,
      "matched": 36
    }
  },
  "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/error_fallback.rs#L45-L53",
        "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/error_fallback.rs#L69-L77"
      ],
      "repository": "https://github.com/DnaCalc/DnaCalc",
      "shared_code": [
        "catalogue/error_fallback::fallback_selected",
        "catalogue/error_fallback::not_scalar"
      ],
      "source": "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/error_fallback.rs#L45-L53",
      "state": "matches",
      "suite": null,
      "summary": "Matches all 36 recorded answers"
    }
  ],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.IFNA.json",
  "name": "IFNA",
  "notes": [],
  "schema": "efh.function-reference/v1",
  "section_order": [
    "what-it-does",
    "try-it",
    "quirks",
    "how-to-implement",
    "version-differences",
    "alternatives"
  ],
  "sections": {
    "alternatives": "\n### Relationships\n\n\n- **`IFERROR`** is the total mask. The pair is the clearest total-versus-selective contrast in the\n  library, and choosing between them is a real design decision in every lookup formula.\n- **`ISNA`** is the inspection counterpart; `IF(ISNA(x), y, x)` is the older idiom, which evaluates\n  `x` twice.\n- **`ISERR`** is `ISERROR` minus `#N/A` — the complement of what `IFNA` catches, from the\n  inspection side.\n- **`NA()`** produces the value `IFNA` looks for.\n- **`XLOOKUP`** takes an `if_not_found` argument, folding this behaviour into the lookup itself;\n  where `XLOOKUP` is available it usually removes the need for `IFNA` entirely, and the two should\n  not be stacked.\n- `IFNA` arrived in Excel 2013 and has no Compatibility-category predecessor; the pre-2013 form is\n  the `IF(ISNA(...))` idiom.\n\n\n",
    "how-to-implement": "\n### Notes for implementers\n\n\n1. **Match on the code, not the family.** The test is equality with the single `#N/A` code. An\n   implementation that tests \"is it a legacy-family error\" or \"is it a lookup error\" is a different\n   function.\n2. **Do not route `IFNA` through a shared `IFERROR` helper parameterised only by fallback.** The\n   two differ in exactly one predicate, which makes the shared-helper refactor tempting and makes\n   an accidental widening of the predicate invisible in review.\n3. **The `Missing` mapping is observable.** Mapping an omitted slot to `#VALUE!` means `IFNA` and\n   `IFERROR` give different answers for the same malformed call. Whichever mapping is chosen, it\n   should be chosen deliberately.\n4. **Preserve rich payloads on the pass-through path**, as with `IFERROR`.\n\n\n",
    "quirks": "\n### Result and edge cases\n\n\nReturns whatever kind the selected argument carries.\n\n- **Primary is `#N/A`.** The fallback is returned.\n- **Primary is any other error.** Returned unchanged — this is the defining behaviour, and the one\n  readers migrating from `IFERROR` are surprised by.\n- **Primary is a normal value.** Returned verbatim.\n- **Fallback is itself `#N/A`.** Returned as-is; the mask does not iterate.\n- **Arrays.** Whether the mask applies elementwise to an array primary or to the array as a whole\n  is not settled by any source consulted here; see below.\n\n\n",
    "sources": "- `data/functions/FUNC.IFNA.json`, `data/presence/FUNC.IFNA.json`.\n\n\n",
    "version-differences": "No comparison between specific Excel builds is recorded here yet. This does not establish that all builds behave alike.",
    "what-it-does": "\n`IFNA(value, value_if_na)` returns `value` unless `value` is the specific error `#N/A`, in which\ncase it returns `value_if_na`.\n\nThe test is on **one error code**, not on error-ness. `#DIV/0!`, `#VALUE!`, `#REF!`, `#NAME?`,\n`#NUM!`, `#NULL!` and the extended-family codes all pass straight through unmasked. That single\nsentence is the whole reason the function exists.\n\nWhy it matters: `#N/A` is the conventional \"no match\" result of the lookup family\n([chapter 01](../model/01-value-universe.md)), and it is the only error in ordinary lookup use that\nmeans *the data said no* rather than *the formula is broken*. `IFNA` is therefore the mask that\nsuppresses the expected answer while leaving genuine breakage visible. `IFERROR` around the same\nlookup suppresses both, which is how a deleted column or a misspelled range name turns into a\nplausible-looking blank instead of an error.\n\nLike `IF` and `IFERROR`, `IFNA` is a lazy selector: the fallback is reached only when the primary\nis `#N/A`, and the selected value is returned verbatim without coercion.\n\n\n\n### Arguments\n\n\n`IFNA(value, value_if_na)`\n\n- **`value`** — required. The expression to test; in practice, the lookup you actually wanted.\n\n\n"
  },
  "signature": {
    "display": "IFNA(value, value_if_na)",
    "parameters": [
      {
        "description": null,
        "name": "value",
        "optional": false,
        "repeats": false
      },
      {
        "description": null,
        "name": "value_if_na",
        "optional": false,
        "repeats": false
      }
    ],
    "trailing_repeats": false
  },
  "sources": {
    "metadata": {
      "admission": {
        "label": "implemented",
        "reason": null
      },
      "arity": {
        "max": 2,
        "min": 2
      },
      "category": "Logical functions",
      "classification": {
        "arg_preparation_profile": "RefsVisibleInAdapter",
        "coercion_lift_profile": "Custom",
        "determinism_class": "Deterministic",
        "error_collapse_profile": "SelectorBranch",
        "fec_dependency_profile": "None",
        "host_interaction_class": "None",
        "kernel_signature_class": "Custom",
        "rich_value_usage": "RichBlind",
        "surface_fec_dependency_profile": "RefOnly",
        "thread_safety_class": "SafePure",
        "volatility_class": "NonVolatile"
      },
      "descriptions": {
        "long": null,
        "short": "The value of an expression, or a fallback when it is #N/A",
        "short_source": "dna-calc-own"
      },
      "docs": {
        "english_description": "Returns the value you specify if the expression resolves to #N/A, otherwise returns the result of the expression",
        "microsoft_url": "https://support.microsoft.com/en-us/office/ifna-function-6626c961-a569-42fc-a49d-79b4951fd461"
      },
      "entry_kind": "built_in_function",
      "localized_family_names": null,
      "localized_names": [
        {
          "locale": "ar-SA",
          "name": "IFNA"
        },
        {
          "locale": "bg-BG",
          "name": "IFNA"
        },
        {
          "locale": "cs-CZ",
          "name": "IFNA"
        },
        {
          "locale": "da-DK",
          "name": "HVISIT"
        },
        {
          "locale": "de-DE",
          "name": "IFNA"
        },
        {
          "locale": "el-GR",
          "name": "IFNA"
        },
        {
          "locale": "en-AU",
          "name": "IFNA"
        },
        {
          "locale": "en-GB",
          "name": "IFNA"
        },
        {
          "locale": "en-US",
          "name": "IFNA"
        },
        {
          "locale": "es-ES",
          "name": "SI.ND"
        },
        {
          "locale": "et-EE",
          "name": "IFNA"
        },
        {
          "locale": "fi-FI",
          "name": "JOSPUUTTUU"
        },
        {
          "locale": "fr-FR",
          "name": "SI.NON.DISP*"
        },
        {
          "locale": "he-IL",
          "name": "IFNA"
        },
        {
          "locale": "hr-HR",
          "name": "IFNA"
        },
        {
          "locale": "hu-HU",
          "name": "HAHIÁNYZIK"
        },
        {
          "locale": "id-ID",
          "name": "IFNA"
        },
        {
          "locale": "it-IT",
          "name": "IFNA"
        },
        {
          "locale": "ja-JP",
          "name": "IFNA"
        },
        {
          "locale": "ko-KR",
          "name": "IFNA"
        },
        {
          "locale": "lt-LT",
          "name": "IFNA"
        },
        {
          "locale": "lv-LV",
          "name": "IFNA"
        },
        {
          "locale": "nb-NO",
          "name": "IFNA"
        },
        {
          "locale": "nl-NL",
          "name": "ALS.NB"
        },
        {
          "locale": "pl-PL",
          "name": "JEŻELI.ND"
        },
        {
          "locale": "pt-BR",
          "name": "IFNA"
        },
        {
          "locale": "pt-PT",
          "name": "SEND"
        },
        {
          "locale": "ro-RO",
          "name": "IFNA"
        },
        {
          "locale": "ru-RU",
          "name": "ЕСНД"
        },
        {
          "locale": "sk-SK",
          "name": "IFNA"
        },
        {
          "locale": "sl-SI",
          "name": "IFNA"
        },
        {
          "locale": "sr-Latn-RS",
          "name": "IFNA"
        },
        {
          "locale": "sv-SE",
          "name": "OMSAKNAS"
        },
        {
          "locale": "th-TH",
          "name": "IFNA"
        },
        {
          "locale": "tr-TR",
          "name": "EĞERYOKSA"
        },
        {
          "locale": "uk-UA",
          "name": "IFNA"
        },
        {
          "locale": "vi-VN",
          "name": "IFNA"
        },
        {
          "locale": "zh-CN",
          "name": "IFNA"
        },
        {
          "locale": "zh-HK",
          "name": "IFNA"
        },
        {
          "locale": "zh-TW",
          "name": "IFNA"
        }
      ],
      "signature": {
        "display": "IFNA(value, value_if_na)",
        "parameters": [
          {
            "description": null,
            "name": "value",
            "optional": false,
            "repeats": false
          },
          {
            "description": null,
            "name": "value_if_na",
            "optional": false,
            "repeats": false
          }
        ],
        "trailing_repeats": false
      },
      "surface_name": "IFNA",
      "version_marker": null,
      "xlcall": {
        "code": "590",
        "symbol": "xlfIfna"
      }
    },
    "microsoft": "https://support.microsoft.com/en-us/office/ifna-function-6626c961-a569-42fc-a49d-79b4951fd461"
  },
  "try_it": {
    "formula": "=IFNA(NA(),\"fallback\")"
  },
  "url": "https://handbook.dnacalc.com/functions/IFNA.html",
  "variants": [],
  "versions": []
}