IFNA
ALS.NB in Dutch Excel
Returns a fallback of your choice when a formula produces #N/A, and passes every other result through unchanged, including other errors.
Last updated: 13 October 2026
| Row | A | B | C | D | E |
|---|---|---|---|---|---|
| 1 | VAT code | Rate | VAT code on the line | Rate | |
| 2 | H21 | 21%21% | H19 | 0%0%=IFNA(VLOOKUP(D2, A2:B4, 2, FALSE), 0)=IFNA(VLOOKUP(D2; A2:B4; 2; FALSE); 0) | |
| 3 | L9 | 9%9% | |||
| 4 | V0 | 0%0% |
Swipe sideways to see all columns
Result: 0%
=IFNA(VLOOKUP(D2,A2:B4, 2, FALSE), 0)
=IFNA(VLOOKUP(D2;A2:B4; 2; FALSE); 0)
What IFNA does and when to use it
What it does: it replaces only the #N/A error with a value you choose, for example the text Not in list for a customer who is missing from the list.
When to use it: around any lookup where "not found" is a normal outcome, such as an unknown code or a product missing from the price list. Unlike IFERROR it leaves other errors such as #REF! visible, so real problems still show.
Two main gains:
- Only #N/A: a #REF! or #VALUE! still shows, where IFERROR would hide it.
- Clear intent: a reader sees at once that the formula expects a missing value.
How Excel evaluates it
Excel evaluates value first. If the result is #N/A, IFNA returns value_if_na instead. If the result is anything else, a number, text, a date, or a different error, IFNA returns it unchanged.
When value is an array, IFNA checks each element separately, so one missing item does not replace the whole result.
Watch out: IFNA catches only #N/A. A division by zero or any other error passes through unchanged, so test the divisor with IF, or use IFERROR once you have checked that no other error can occur.
Mental model
A filter in a pipe that only stops one kind of particle. #N/A is caught and swapped; everything else, good results and other errors, flows straight through.
Terms used on this page: error value, array
IFNA(value,value_if_na)
IFNA(value;value_if_na)
| Argument | Type | Meaning |
|---|---|---|
value | Required | The formula or value to check for #N/A. |
value_if_na | Required | What to return instead of #N/A. |
Return value:The result of value, or value_if_na when value is #N/A
Formulas use commas (,) between arguments, as in English Excel. Formulas use semicolons (;) between arguments, as in Dutch Excel. Formulas use commas (,) between arguments, as in English Excel; Dutch Excel uses semicolons (;).
Worked examples
Beginner
Recalculate VAT with an unknown VAT code at 0%
You recalculate the VAT on the sales journal (VRK) of Veldhuis Installatie BV. The client's VAT code table gives the rate per code.
A journal line with a code that is not in the table must get a rate of 0 instead of an error, so the recalculated VAT column still adds up and the difference with the booked VAT shows you the line to investigate.
| Row | A | B | C | D | E | F |
|---|---|---|---|---|---|---|
| 1 | VAT code | Rate | VAT code on the line | Rate | ||
| 2 | H21 | 21%21% | H19 | 0%0%=IFNA(VLOOKUP(D2, A2:B4, 2, FALSE), 0)=IFNA(VLOOKUP(D2; A2:B4; 2; FALSE); 0) | ||
| 3 | L9 | 9%9% | ||||
| 4 | V0 | 0%0% | ||||
| 5 |
Swipe sideways to see all columns
Formula in E2
=IFNA(VLOOKUP(D2,A2:B4, 2, FALSE), 0)
=IFNA(VLOOKUP(D2;A2:B4; 2; FALSE); 0)
Result: 0%0%
Step by step
- Excel evaluates value first: VLOOKUP looks for
D2,H19, inA2:A4with an exact match. H21, no (close, but not the same);L9, no;V0, no. VLOOKUP reaches the end without a match and returns #N/A.- IFNA sees #N/A and returns value_if_na instead: 0.
- The cell shows 0%, so a recalculation such as net amount × rate gives 0 VAT for this line instead of an error. Next to the booked VAT the difference stands out.
- Type
L9inD2. VLOOKUP finds it in the second row, returns 0.09, and IFNA passes it through unchanged: 9%.
Watch out: A rate of 0 is also the real rate of code V0. An unknown code and a zero-rated code now look the same in the rate column, so check the difference with the booked VAT, or test the code with COUNTIF, before you accept a line.
More on this example: why it works
Why it works
IFNA only steps in when the lookup reports 'not found'. Returning a number instead of text keeps the column numeric, so the recalculated VAT and the total of the differences keep working.
Intermediate
Compare ledger and aging list, flag unlisted invoices
You compare the balance per invoice in the general ledger with the receivables aging list that Veldhuis Installatie BV supplied. An invoice that is not on the aging list must show 'Not in list'.
One line on the aging list has the text 'to be agreed' instead of an amount, and that problem must stay visible, because it needs a different action: asking the client.
| Row | A | B | C | D | E | F | G | H |
|---|---|---|---|---|---|---|---|---|
| 1 | Invoice no. | Relation | Open amount | Invoice no. | Ledger balance | Difference | ||
| 2 | 25-3101 | D1001 | €12,100.00€ 12.100,00 | 25-3099 | €5,000.00€ 5.000,00 | Not in list=IFNA(F2 - VLOOKUP(E2, $A$2:$C$6, 3, FALSE), "Not in list")=IFNA(F2 - VLOOKUP(E2; $A$2:$C$6; 3; FALSE); "Not in list") | ||
| 3 | 25-3108 | D1004 | €4,537.50€ 4.537,50 | 25-3115 | €2,420.00€ 2.420,00 | |||
| 4 | 25-3115 | D1007 | to be agreed | 25-3108 | €4,600.00€ 4.600,00 | |||
| 5 | 25-3122 | D1002 | €8,470.00€ 8.470,00 | |||||
| 6 | 25-3130 | D1009 | €1,815.00€ 1.815,00 | |||||
| 7 |
Swipe sideways to see all columns
Formula in G2
=IFNA(F2 - VLOOKUP(E2,$A$2:$C$6, 3, FALSE), "Not in list")
=IFNA(F2 - VLOOKUP(E2;$A$2:$C$6; 3; FALSE); "Not in list")
Result: Not in list
Step by step
- In
G2, VLOOKUP looks for25-3099inA2:A6.25-3101, no;25-3108, no; and so on to the end. The invoice is not there, so VLOOKUP returns #N/A. F2minus #N/A is still #N/A. IFNA catches it and returns Not in list.- Copied to
G3, VLOOKUP finds25-3115in the third row and returns the text to be agreed. 2420 minus text gives #VALUE!. - #VALUE! is not #N/A, so IFNA lets it through.
G3shows #VALUE!, which tells you the aging list is the problem, not the invoice number. - In
G4, VLOOKUP finds25-3108and returns 4537.5. 4600 - 4537.5 = 62.5, which IFNA passes through: a difference of 62.50 to explain. - With IFERROR in place of IFNA,
G3would also say Not in list, and you would look for an invoice that is on the list.
Watch out: Without the $ signs, the copy in G4 would search A4:C8, which starts below 25-3108. G4 would then say Not in list for an invoice that is on the list.
More on this example: why it works, 1 variation
Why it works
Each error type means something different: #N/A says 'the invoice is not on the list', #VALUE! says 'the data could not be used in the calculation'. IFNA replaces only the first, so each line tells you which follow-up it needs.
Variations
=F2 - IFNA(VLOOKUP(E2,$A$2:$C$6, 3, FALSE), "Not in list")
=F2 - IFNA(VLOOKUP(E2;$A$2:$C$6; 3; FALSE); "Not in list")
Not a good alternative: the message is subtracted from F2 and becomes #VALUE!. Keep the arithmetic inside IFNA, or return a number as the fallback.
Advanced
Map an account by new number, then by old number
Veldhuis Installatie BV changed its chart of accounts during the year, so the XAF auditfile contains both new and old account numbers. To map an account to its financial statement line, the lookup must first try the new account column and, only if that fails, the old account column, and show 'Unknown account' when neither matches.
| Row | A | B | C | D | E | F | G |
|---|---|---|---|---|---|---|---|
| 1 | New account | Old account | Statement line | Account in journal line | 4510 | ||
| 2 | 8000 | 8100 | Revenue | Statement line | Housing costs=IFNA(INDEX(C2:C7, MATCH(F1, A2:A7, 0)), IFNA(INDEX(C2:C7, MATCH(F1, B2:B7, 0)), "Unknown account"))=IFNA(INDEX(C2:C7; MATCH(F1; A2:A7; 0)); IFNA(INDEX(C2:C7; MATCH(F1; B2:B7; 0)); "Unknown account")) | ||
| 3 | 4000 | 4100 | Personnel costs | ||||
| 4 | 4500 | 4510 | Housing costs | ||||
| 5 | 1100 | 1110 | Cash and banks | ||||
| 6 | 1300 | Receivables | |||||
| 7 | 1600 | 1610 | Payables | ||||
| 8 |
Swipe sideways to see all columns
Formula in F2
=IFNA(INDEX(C2:C7,MATCH(F1, A2:A7, 0)), IFNA(INDEX(C2:C7, MATCH(F1, B2:B7, 0)), "Unknown account"))
=IFNA(INDEX(C2:C7;MATCH(F1; A2:A7; 0)); IFNA(INDEX(C2:C7; MATCH(F1; B2:B7; 0)); "Unknown account"))
Result: Housing costs
Step by step
- Excel evaluates the first value. MATCH looks for 4510 in
A2:A7, the new accounts. None of them match, so MATCH returns #N/A. - INDEX receives #N/A as its row number and passes the #N/A on. The outer IFNA sees #N/A, so it evaluates its value_if_na, which is the second IFNA.
- Inside it, MATCH looks for 4510 in
B2:B7, the old accounts: 8100, no; 4100, no; 4510, yes. Position 3. - INDEX returns the third cell of
C2:C7, which isC4: Housing costs. That is not an error, so both IFNA functions pass it through. - Type 8000 in
F1: the first MATCH finds it at position 1, INDEX returns Revenue, and the second lookup is never needed. - Type 9999: both MATCH functions return #N/A, and the inner IFNA returns Unknown account.
Watch out: If a new account number happens to equal an old number of a different account, the first lookup succeeds and returns the wrong statement line. Nothing signals the mix-up; check that the two columns cannot overlap.
More on this example: why it works, 1 more pitfall, 1 variation
Why it works
value_if_na can be a whole formula, so a second IFNA becomes the fallback of the first and builds a chain of attempts in a fixed order. Because only #N/A moves the search to the next step, a different error in the first lookup, such as #REF! from a deleted column, stops the chain where you can see it.
More to watch out for
- If the account numbers in the auditfile were imported as numbers (4510) while the mapping table holds text, no account ever matches and every account shows Unknown account.
Variations
=XLOOKUP(F1,A2:A7, C2:C7, XLOOKUP(F1, B2:B7, C2:C7, "Unknown account"))
=XLOOKUP(F1;A2:A7; C2:C7; XLOOKUP(F1; B2:B7; C2:C7; "Unknown account"))
Excel 2021 and later: the if_not_found argument of the first XLOOKUP holds the second lookup, no IFNA needed.
MasterExcel 2021 or later (This example needs Excel 2021 or later)
Total difference with the trial balance, missing accounts at zero
You compare four ledger balances from the XAF auditfile with the trial balance (saldibalans) of Veldhuis Installatie BV and want the sum of the absolute differences in one cell.
Account 1700 is not on the client's trial balance; for this estimate its specification counts as zero, so the whole ledger balance is a difference, instead of the total becoming unusable. Any other problem in the trial balance must still produce an error.
| Row | A | B | C | D | E | F | G | H | I |
|---|---|---|---|---|---|---|---|---|---|
| 1 | Account | Description | Trial balance | Account | Ledger balance | Total difference | |||
| 2 | 1100 | Cash at bank | €48,250.00€ 48.250,00 | 1300 | €214,900.00€ 214.900,00 | €7,450.00€ 7.450,00=LET( accounts, E2:E5, ledger, F2:F5, spec, IFNA(XLOOKUP(accounts, A2:A6, C2:C6), 0), SUM(ABS(ledger - spec)) )=LET( accounts; E2:E5; ledger; F2:F5; spec; IFNA(XLOOKUP(accounts; A2:A6; C2:C6); 0); SUM(ABS(ledger - spec)) ) | |||
| 3 | 1300 | Receivables | €212,400.00€ 212.400,00 | 1700 | €3,150.00€ 3.150,00 | ||||
| 4 | 1600 | Payables | €96,800.00€ 96.800,00 | 4000 | €383,200.00€ 383.200,00 | ||||
| 5 | 4000 | Personnel costs | €385,000.00€ 385.000,00 | 1100 | €48,250.00€ 48.250,00 | ||||
| 6 | 8000 | Revenue | €1,450,000.00€ 1.450.000,00 | ||||||
| 7 |
Swipe sideways to see all columns
Formula in H2
=LET( accounts,E2:E5, ledger, F2:F5, spec, IFNA(XLOOKUP(accounts, A2:A6, C2:C6), 0), SUM(ABS(ledger - spec)) )
=LET( accounts;E2:E5; ledger; F2:F5; spec; IFNA(XLOOKUP(accounts; A2:A6; C2:C6); 0); SUM(ABS(ledger - spec)) )
Result: €7,450.00€ 7.450,00
Step by step
- LET names the selected lines: accounts is
E2:E5and ledger isF2:F5. - XLOOKUP receives all four accounts at once and returns four results: 1300 gives 212400, 1700 is not in
A2:A6and gives #N/A, 4000 gives 385000, 1100 gives 48250. - IFNA checks each element separately. Only the second one is #N/A, so spec becomes {212400; 0; 385000; 48250}.
- ledger - spec subtracts element by element: 214900 - 212400 = 2500, 3150 - 0 = 3150, 383200 - 385000 = -1800, 48250 - 48250 = 0.
- ABS removes the signs, giving {2500; 3150; 1800; 0}, and SUM adds them: 2500 + 3150 + 1800 + 0 = 7450.
- Now suppose
C5held the text n/a. XLOOKUP would return that text for account 4000, IFNA would leave it alone, 383200 minus text would be #VALUE!, and the total would show #VALUE! instead of a figure that is too low.
Watch out: The mirror-image mistake: IFERROR instead of IFNA. On this data the result is the same 7450, so it looks right, but an error value in the balance column (such as #VALUE! or #REF!) would then also count as zero and the difference would come out wrong without any warning.
More on this example: why it works, 2 more pitfalls, 1 variation
Why it works
IFNA works element by element on arrays, so it repairs exactly the accounts that are missing and leaves the rest as they are.
Do not use this construction for a final reconciliation that you file as audit evidence: there an account missing from the trial balance must be investigated, not quietly counted as a specification of zero.
The alternative is the if_not_found argument of XLOOKUP, XLOOKUP(accounts, A2:A6, C2:C6, 0): it catches only 'not found', while IFNA also replaces a #N/A that comes out of the balance column itself, for example from an upstream formula. Choose if_not_found when such a #N/A in the data should stay visible.
More to watch out for
- The total does not say how many accounts were treated as zero. Add a check cell such as SUM(--ISNA(XLOOKUP(E2:E5, A2:A6, C2:C6))), which returns 1 here.
- accounts and ledger must have the same number of rows.
E2:E5againstF2:F6gives #N/A in the last position of the subtraction, which IFNA does not reach because it sits outside it.
Variations
=SUMPRODUCT(ABS(F2:F5 - IFNA(XLOOKUP(E2:E5,A2:A6, C2:C6), 0)))
=SUMPRODUCT(ABS(F2:F5 - IFNA(XLOOKUP(E2:E5;A2:A6; C2:C6); 0)))
Without LET: SUMPRODUCT adds the absolute differences in one step. Shorter, but harder to read when the rule changes.
Common mistakes
| Symptom | Cause | Fix |
|---|---|---|
| A broken lookup shows as Not found | IFERROR is used around a lookup and a #REF! from a deleted column shows up as 'Not found', so nobody repairs the formula. | Use IFNA for lookups. A missing value becomes your message; a broken formula stays visible. |
| A total below returns #VALUE! | value_if_na is text such as "none", and a total further down returns #VALUE! or ignores the row. | When the result feeds arithmetic, return 0 (or another number) instead of text. |
| A #N/A elsewhere is hidden too | IFNA is wrapped around a whole calculation, and a #N/A from a different part of the formula is replaced as well. | Wrap only the lookup that can legitimately miss, as close to it as possible. |