Logical functions
IFNA
Matches all 36 recorded answers
Recorded: 36 workbook cells. How we measure this · See the Rust code
Local names in 40 languages
| Language | Name in Excel |
|---|---|
| Arabic | IFNA |
| Bulgarian | IFNA |
| Czech | IFNA |
| Danish | HVISIT |
| German | IFNA |
| Greek | IFNA |
| English (Australia) | IFNA |
| English (United Kingdom) | IFNA |
| English (United States) | IFNA |
| Spanish | SI.ND |
| Estonian | IFNA |
| Finnish | JOSPUUTTUU |
| French | SI.NON.DISP |
| Hebrew | IFNA |
| Croatian | IFNA |
| Hungarian | HAHIÁNYZIK |
| Indonesian | IFNA |
| Italian | IFNA |
| Japanese | IFNA |
| Korean | IFNA |
| Lithuanian | IFNA |
| Latvian | IFNA |
| Norwegian | IFNA |
| Dutch | ALS.NB |
| Polish | JEŻELI.ND |
| Portuguese (Brazil) | IFNA |
| Portuguese (Portugal) | SEND |
| Romanian | IFNA |
| Russian | ЕСНД |
| Slovak | IFNA |
| Slovenian | IFNA |
| Serbian (Latin) | IFNA |
| Swedish | OMSAKNAS |
| Thai | IFNA |
| Turkish | EĞERYOKSA |
| Ukrainian | IFNA |
| Vietnamese | IFNA |
| Chinese (Simplified) | IFNA |
| Chinese (Hong Kong) | IFNA |
| Chinese (Traditional) | IFNA |
Names from Microsoft's support site.
What it does
IFNA(value, value_if_na)
IFNA(value, value_if_na) returns value unless value is the specific error #N/A, in which
case it returns value_if_na.
The test is on one error code, not on error-ness. #DIV/0!, #VALUE!, #REF!, #NAME?,
#NUM!, #NULL! and the extended-family codes all pass straight through unmasked. That single
sentence is the whole reason the function exists.
Why it matters: #N/A is the conventional "no match" result of the lookup family
(chapter 01), and it is the only error in ordinary lookup use that
means the data said no rather than the formula is broken. IFNA is therefore the mask that
suppresses the expected answer while leaving genuine breakage visible. IFERROR around the same
lookup suppresses both, which is how a deleted column or a misspelled range name turns into a
plausible-looking blank instead of an error.
Like IF and IFERROR, IFNA is a lazy selector: the fallback is reached only when the primary
is #N/A, and the selected value is returned verbatim without coercion.
Arguments
IFNA(value, value_if_na)
value— required. The expression to test; in practice, the lookup you actually wanted.
Try it
Quirks
Result and edge cases
Returns whatever kind the selected argument carries.
- Primary is
#N/A. The fallback is returned. - Primary is any other error. Returned unchanged — this is the defining behaviour, and the one
readers migrating from
IFERRORare surprised by. - Primary is a normal value. Returned verbatim.
- Fallback is itself
#N/A. Returned as-is; the mask does not iterate. - Arrays. Whether the mask applies elementwise to an array primary or to the array as a whole is not settled by any source consulted here; see below.
How to implement
Notes for implementers
- Match on the code, not the family. The test is equality with the single
#N/Acode. An implementation that tests "is it a legacy-family error" or "is it a lookup error" is a different function. - Do not route
IFNAthrough a sharedIFERRORhelper parameterised only by fallback. The two differ in exactly one predicate, which makes the shared-helper refactor tempting and makes an accidental widening of the predicate invisible in review. - The
Missingmapping is observable. Mapping an omitted slot to#VALUE!meansIFNAandIFERRORgive different answers for the same malformed call. Whichever mapping is chosen, it should be chosen deliberately. - Preserve rich payloads on the pass-through path, as with
IFERROR.
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.
IFNA · 9 lines · calc-func/src/catalogue/error_fallback.rs on GitHubCatalogueEntry {
id: IFNA,
spelling: "IFNA",
notation: Notation::Call,
arity: CallableArityShape::exact(2),
parameters: &[Parameter::value("value"), Parameter::value("value_if_na")],
demand: ArgumentDemand::FallbackOnError,
kernel: Kernel::Lazy(ifna_selected),
}
ifna_selected · 9 lines · calc-func/src/catalogue/error_fallback.rs on GitHub/// IFNA catches #N/A alone; every other error is its result.
fn ifna_selected(
arguments: &mut LazyArguments<'_>,
services: &mut EvalServices<'_>,
) -> Result<CalcValue, FunctionFault> {
fallback_selected(IFNA, arguments, services, |code| {
code == WorksheetErrorCode::NA
})
}
Kernels shared with other functions
fallback_selectedcatalogue/error_fallbacknot_scalarcatalogue/error_fallback
Argument and result plumbing
Parameter::valuecatalogue
No implementation has been published with a Handbook test suite for this function.
Version differences
No comparison between specific Excel builds is recorded here yet. This does not establish that all builds behave alike.
Alternatives
Relationships
IFERRORis the total mask. The pair is the clearest total-versus-selective contrast in the library, and choosing between them is a real design decision in every lookup formula.ISNAis the inspection counterpart;IF(ISNA(x), y, x)is the older idiom, which evaluatesxtwice.ISERRisISERRORminus#N/A— the complement of whatIFNAcatches, from the inspection side.NA()produces the valueIFNAlooks for.XLOOKUPtakes anif_not_foundargument, folding this behaviour into the lookup itself; whereXLOOKUPis available it usually removes the need forIFNAentirely, and the two should not be stacked.IFNAarrived in Excel 2013 and has no Compatibility-category predecessor; the pre-2013 form is theIF(ISNA(...))idiom.
Named variants
No named variants are recorded yet.
Suggest a correction or contribute an implementation · For agents