Vai al contenuto
GridBelt
  • Test Excel
  • Esercizi
  • Programmi
  • Prezzi
Accedi
Inizia il test gratuito
  • Test Excel
  • Esercizi
  • Programmi
  • Prezzi
AccediCrea un account
Inizia il test gratuito
GridBelt

Esercitati con Excel nel tuo browser.

Test Excel

  • Livello 1: Principiante
  • Livello 2: Intermedio
  • Livello 3: Esperto
  • Test Excel in 7 giorni
  • Classifica
  • Test Excel per il colloquio
  • Valutazione Excel di Indeed

Esercizi

  • Tutti gli esercizi
  • Programmi
  • Per principianti

Guide

  • Formule Excel
  • Scorciatoie Excel

Azienda

  • Chi siamo
  • Prezzi
  • Come valutiamo

© GridBelt. Tutti i diritti riservati.

  • Informativa sulla privacy
  • Termini di utilizzo
  • Politica di rimborso

Excel è un marchio di Microsoft Corporation. Indeed, TestGorilla, SHL e gli altri marchi appartengono ai rispettivi proprietari. GridBelt è un sito di esercitazione indipendente e non è affiliato a Microsoft, TestGorilla, SHL o Indeed, né approvato o sponsorizzato da queste società.

  1. Esercizi
  2. /
  3. VLOOKUP

VLOOKUP with IFERROR practice: show "Not found" instead of #N/A

  • Intermedio
  • ~7 min
  • VLOOKUP

Testo dell’esercizio in inglese

Purchasing exported 100 order lines for printer consumables (November 2026) and needs the current unit price on each line from the Products sheet, a 30-SKU catalogue. 5 lines still reference SKUs that were discontinued and removed from the catalogue, so a plain lookup shows #N/A on those rows and breaks every total built on the column. Pull the price with a lookup, replace the error with the text "Not found", and count how many lines have no price.

Cosa devi fare

  1. 1On Orders, click E2 and write the lookup first: =VLOOKUP(C2,Products!$A$2:$D$31,4,FALSE) — click the Products tab and select A2:D31 to get the prefix, F4 / ⌘T to lock it.
  2. 2Wrap it: =IFERROR(VLOOKUP(C2,Products!$A$2:$D$31,4,FALSE),"Not found") — IFERROR returns the lookup when it works and the text when it errors.
  3. 3Fill E2 down to E101; the 5 discontinued SKUs now read "Not found" instead of #N/A.
  4. 4Click H2 and count the lines without a price: a COUNTIF over E2:E101 for the text "Not found".

Celle di risposta

Correzione

Scrivi la formula nella griglia, premi Enter, poi Verifica. Valutiamo il valore in ogni cella di risposta e la formula che lo produce.

Attività

  1. Non verificatoIn E2, look up the unit price of the SKU in C2 on the Products sheet and show "Not found" instead of #N/A when the SKU is missing — IFERROR or IFNA around the lookup (XLOOKUP's if_not_found argument works too) — then fill down to E101.
  2. Non verificatoIn H2, count how many cells in E2:E101 say "Not found".

Consigliato il computer per le attività sul foglio di calcolo. Il foglio scorre all’interno di questo riquadro.

StartInsertFormulasDataView
A1fxPreparazione della cartella di lavoro…
A
B
C
D
E
F
G
H
I
J
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Sheet1

Inserisci la formula nel foglio, poi verifica.

Informazioni sull’esercizio

Un set di dati di 130 righe su 2 fogli, 2 celle di risposta, circa 7 minuti. Correzione nel tuo browser: il valore e la formula che lo produce, con indicazioni su cosa sistemare.

Come risolverlo

  • Orders!E2=IFERROR(VLOOKUP(C2,Products!$A$2:$D$31,4,FALSE),"Not found")
  • Orders!H2=COUNTIF(E2:E101,"Not found")

VLOOKUP with FALSE returns #N/A when the SKU is not in the first column of the table, and any SUM or AVERAGE over a column that contains #N/A becomes #N/A too. IFERROR(value, value_if_error) evaluates the lookup and, only if it produces an error, returns the second argument instead — here the text "Not found" — so the five discontinued lines become readable text and the rest keep their prices. COUNTIF over the finished column counts the text cells: 5 lines need a price decision.

Pitfall 1: IFERROR hides every error, including a #REF! from a broken table reference or a #VALUE! from a typo; IFNA replaces only #N/A, so a genuinely broken formula still shows its error — prefer IFNA when the only expected error is "no match". Pitfall 2: the fallback must be meaningful to whoever consumes the column; "Not found" works for humans, 0 is dangerous because it looks like a free item in totals, and an empty string "" silently disappears from counts. Pitfall 3: in Excel 2003 and earlier IFERROR did not exist, which is why old workbooks use =IF(ISNA(VLOOKUP(...)),"Not found",VLOOKUP(...)) — the lookup runs twice. Alternatives: =IFNA(VLOOKUP(C2,Products!$A$2:$D$31,4,FALSE),"Not found"); =XLOOKUP(C2,Products!$A$2:$A$31,Products!$D$2:$D$31,"Not found") has the fallback built in as its 4th argument (365). Data-quality note: the count in H2 is the real deliverable — the five SKUs need either a replacement product or a clean-up of the order file, and the lookup column is where that gap becomes visible.

Altri metodi validi

  • =IFNA(VLOOKUP(C2,Products!$A$2:$D$31,4,FALSE),"Not found") — catches only #N/A, lets other errors through
  • =XLOOKUP(C2,Products!$A$2:$A$31,Products!$D$2:$D$31,"Not found") — Excel 365; the 4th argument is the fallback
  • =IF(ISNA(VLOOKUP(C2,Products!$A$2:$D$31,4,FALSE)),"Not found",VLOOKUP(C2,Products!$A$2:$D$31,4,FALSE)) — the pre-2007 pattern
  • =COUNTA(E2:E101)-COUNT(E2:E101) in H2 — text cells = everything minus the numbers

Errori comuni

Putting the fallback inside VLOOKUP, e.g. =VLOOKUP(C2,Products!$A$2:$D$31,4,"Not found"): the 4th argument of VLOOKUP is the match type, not a fallback. The error handler wraps the whole lookup — IFERROR( lookup , "Not found" ).

Come valutiamo

È accettata qualsiasi formula che produce il risultato giusto, a meno che l’attività non indichi una funzione: in quel caso un’altra funzione vale metà dei punti. Confrontiamo i valori con una piccola tolleranza e ignoriamo maiuscole, minuscole e spazi nel testo. Un numero corretto digitato a mano invece di una formula vale metà dei punti. Le attività su più celle valgono il punteggio pieno con il 100% delle celle giuste, metà dei punti dal 50%. Dove serve, cambiamo anche una cella di input su una copia del tuo foglio e controlliamo che la formula si aggiorni.

Risposte calcolate con le regole di Excel 365 e verificate nel nostro correttore in data 16 novembre 2026. Autore: GridBelt team.

In questi programmi

  • Excel test in 7 days, Piano di livello 2Giorno 3
  • Excel for Administrative AssistantsGiorno 8
  • Excel for Accounting and BookkeepingGiorno 6

Esercizi correlati

  • Pull the unit price with VLOOKUP (exact match)Principiante, ~5 min
  • Look up a customer tier from another sheetPrincipiante, ~5 min
  • Replace VLOOKUP with XLOOKUPIntermedio, ~6 min
  • INDEX and MATCH exact lookupIntermedio, ~6 min

Guida alla funzione

Documentazione ufficiale

Esercizio successivo

Pick the month column with MATCH