Choose between VLOOKUP, XLOOKUP, and INDEX/MATCH

Autor: AILesson6 min de preparaciónProbado con:ChatGPTRevisado el: 2026-08-28

Respuesta rápida

Select a lookup pattern from workbook compatibility, match behavior, layout, maintainability, and data risk. Proporciona: Lookup task and layout, Match and exception rules, Excel environment and maintenance. Resultado esperado: A justified lookup choice with formula, alternatives, data checks, and compatibility notes.

1

Añade tu contexto

Tu texto permanece en este navegador. AILesson Prompts no lo envía a un modelo ni a un servidor.

2

Tu prompt

Los campos sin rellenar permanecen visibles como marcadores de posición, para que puedas copiar y editar el prompt

Choose among VLOOKUP, XLOOKUP, and INDEX/MATCH for the stated Excel lookup.

Lookup value, source key, return field, layout, direction, first row, and copy behavior:
[task]

Match mode, uniqueness, duplicates, blanks, errors, criteria, and expected tests:
[rules]

Excel versions/platforms, recipients, tables/ranges, layout-change risk, performance, and familiarity:
[environment]

Evaluate each pattern against required match semantics and the oldest environment that must calculate the workbook. Do not choose from novelty or formula length alone. Check whether the return column is left of the key, columns may be inserted, exact match must be explicit, first/last or next-larger behavior is needed, source keys are sorted when approximate matching is used, and duplicates make any single-result lookup ambiguous. Prefer structured references where supported and bounded ranges where whole-column calculation would be costly. Return: decision matrix; recommended formula for the first row; argument explanation; why the other two are weaker here; compatible fallback; blank/no-match/duplicate behavior; data-type and normalization checks; and at least five tests with expected results.
Probar en Playground
Privado de forma predeterminadaLa preparación del prompt se realiza localmente en tu navegador. Evita introducir información confidencial en cualquier servicio de IA, a menos que tu organización lo permita.

De la entrada al resultado

Un ejemplo completo

Mira cómo un contexto concreto convierte esta receta en un resultado que puedes usar

Entrada real

Lookup task and layout
In Orders!F2, use Customer ID from Orders!B2 to return Risk Tier from Customers!B:B. Customers key is in D:D, so the return column is left of the key. Copy down about 8,000 orders. Rows 2:5000 contain customer data. Columns may be inserted during quarterly updates.
Match and exception rules
Exact match only. Blank order Customer ID returns blank. Unknown ID returns Review. Customers ID should be unique; duplicate IDs must be flagged before results are trusted. IDs can arrive as numeric text. Expected known case C-104 -> Medium.
Excel environment and maintenance
Workbook is edited in Excel 2016 for Windows by two users and Microsoft 365 by three users. Everyone must be able to recalculate it. Source is a normal range, not an Excel Table. Team knows VLOOKUP but accepts a documented INDEX/MATCH. Avoid whole-column array calculations if unnecessary.

Ejemplo de salida

Decision: use INDEX/MATCH because Excel 2016 must recalculate the workbook, the return column is left of the key, and column insertion makes a VLOOKUP column index brittle. XLOOKUP is the clearest modern option but is not available in the required oldest version.

Formula for Orders!F2: =IF(B2="","",IFERROR(INDEX(Customers!$B$2:$B$5000,MATCH(B2,Customers!$D$2:$D$5000,0)),"Review")). MATCH finds the exact key position because its third argument is 0; INDEX returns the same position from the risk-tier range. IF preserves blank input, while IFERROR supplies the approved no-match label. Before use, check =COUNTIF(Customers!$D$2:$D$5000,D2) and resolve counts above 1; the lookup formula itself cannot decide which duplicate is valid.

Matrix: XLOOKUP supports left lookup and explicit no-match cleanly but fails Excel 2016 compatibility. VLOOKUP works only by rearranging or duplicating the key to the left of the return field and a numeric column index can break after insertions. INDEX/MATCH satisfies compatibility, left return, and layout resilience. Microsoft 365-only alternative: =IF(B2="","",XLOOKUP(B2,Customers!$D$2:$D$5000,Customers!$B$2:$B$5000,"Review",0)).

Tests: C-104 → Medium; blank → blank; unknown C-999 → Review; text ID versus differently typed source → Review until normalized; duplicated C-104 → duplicate check >1 and result not trusted; insert a column between B and D → formula references shift with the data and should still return the same tier.

Por qué funciona

  1. 1

    Compatibility and match semantics determine whether a formula works, while function preference alone does not.

  2. 2

    Comparing failure behavior exposes duplicates and approximate-match risks before choosing syntax.

Comprueba el resultado

  • Will the recommended formula calculate in every required Excel version and platform?

  • Does its match mode exactly reflect uniqueness, sort order, direction, and duplicate policy?

  • Do tests include blank, no match, type mismatch, duplicate, and a known valid key?

Úsalo con confianza

Preguntas frecuentes

Respuestas prácticas sobre cuándo usar esta receta, qué debes proporcionar y en qué casos la revisión humana sigue siendo importante

What should I prepare before using “Choose between VLOOKUP, XLOOKUP, and INDEX/MATCH”?

For “Choose between VLOOKUP, XLOOKUP, and INDEX/MATCH,” prepare Lookup task and layout, Match and exception rules, and Excel environment and maintenance. Replace placeholders only with information you can verify. If a detail is unknown, preserve that uncertainty explicitly instead of asking the model to infer it.

When is the “Choose between VLOOKUP, XLOOKUP, and INDEX/MATCH” result not ready to use?

The result is not ready if it does not yet deliver the stated outcome—A justified lookup choice with formula, alternatives, data checks, and compatibility notes—from the supplied evidence, or if it relies on unresolved assumptions, missing approvals, or invented details. Use the checks as release gates: revise the source inputs or assign a named, authorized reviewer instead of polishing an unsupported output.

Which AI tools have recorded tests for “Choose between VLOOKUP, XLOOKUP, and INDEX/MATCH”?

The published test record for “Choose between VLOOKUP, XLOOKUP, and INDEX/MATCH” lists ChatGPT as of 2026-08-28. This confirms recorded runs, not guaranteed compatibility or identical results in later product versions. For another tool or version, keep every constraint visible and repeat the result checks before use.

Mantén el trabajo en marcha