Saltar al contenido
GridBelt
  • Prueba de Excel
  • Práctica
  • Programas
  • Precios
Iniciar sesión
Empezar la prueba gratuita
  • Prueba de Excel
  • Práctica
  • Programas
  • Precios
Iniciar sesiónCrear cuenta
Empezar la prueba gratuita
GridBelt

Practica Excel en tu navegador.

Prueba de Excel

  • Nivel 1: Principiante
  • Nivel 2: Intermedio
  • Nivel 3: Experto
  • Prueba de Excel en 7 días
  • Clasificación
  • Prueba de Excel para entrevistas
  • Evaluación de Excel de Indeed

Práctica

  • Todos los ejercicios
  • Programas
  • Para principiantes

Guías

  • Fórmulas de Excel
  • Atajos de Excel

Empresa

  • Acerca de
  • Precios
  • Cómo corregimos

© GridBelt. Todos los derechos reservados.

  • Política de privacidad
  • Términos de uso
  • Política de reembolso

Excel es una marca comercial de Microsoft Corporation. Indeed, TestGorilla, SHL y otras marcas son propiedad de sus respectivos titulares. GridBelt es un sitio de práctica independiente y no está afiliado a Microsoft, TestGorilla, SHL ni Indeed, ni respaldado ni patrocinado por ellos.

  1. Práctica
  2. /
  3. VLOOKUP

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

  • Intermedio
  • ~7 min
  • VLOOKUP

Enunciado en inglés

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.

Qué tienes que hacer

  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".

Celdas de respuesta

Corrección

Escribe tu fórmula en la cuadrícula, presiona Enter y luego haz clic en Comprobar. Evaluamos el valor de cada celda de respuesta y la fórmula que lo produce.

Tareas

  1. Sin comprobarIn 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. Sin comprobarIn H2, count how many cells in E2:E101 say "Not found".

Para las tareas de hoja de cálculo se recomienda una pantalla grande. La hoja se desplaza dentro de este recuadro.

StartInsertFormulasDataView
A1fxPreparando tu libro…
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

Escribe tu fórmula en la hoja y luego comprueba.

Sobre este ejercicio

Un conjunto de datos de 130 filas en 2 hojas, 2 celdas de respuesta, unos 7 minutos. Se corrige en tu navegador: el valor y la fórmula que lo produce, con comentarios que te dicen qué arreglar.

Cómo resolverlo

  • 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.

Otras formas válidas

  • =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

Errores frecuentes

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" ).

Cómo corregimos

Se acepta cualquier fórmula que produzca el resultado correcto, salvo que la tarea nombre una función: entonces otra función obtiene media puntuación. Comparamos los valores con una pequeña tolerancia y, en el texto, ignoramos mayúsculas y espacios. Un número correcto escrito a mano en lugar de una fórmula obtiene media puntuación. Las tareas de varias celdas obtienen la puntuación completa con el 100% de las celdas correctas y media puntuación desde el 50%. Cuando importa, también cambiamos una celda de entrada en una copia de tu hoja y comprobamos que tu fórmula se adapta.

Respuestas calculadas con las reglas de Excel 365 y comprobadas en nuestro corrector el 16 de noviembre de 2026. Autor: GridBelt team.

En estos programas

  • Excel test in 7 days, Plan del nivel 2Día 3
  • Excel for Administrative AssistantsDía 8
  • Excel for Accounting and BookkeepingDía 6

Ejercicios relacionados

  • 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

Referencia de la función

Documentación oficial

Siguiente ejercicio

Pick the month column with MATCH