Choose between VLOOKUP, XLOOKUP, and INDEX/MATCH

Auteur: AILesson6 min de préparationTesté avec:ChatGPTRévisé: 2026-08-28

Réponse rapide

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

1

Ajouter votre contexte

Votre texte reste dans ce navigateur. AILesson Prompts ne l’envoie ni à un modèle ni à un serveur.

2

Votre prompt

Les champs non remplis restent visibles sous forme d’espaces réservés, afin que vous puissiez quand même copier et modifier le 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.
Essayer dans le Playground
Privé par défautL’assemblage du prompt se fait localement dans votre navigateur. Évitez de placer des informations confidentielles dans un service d’IA, sauf si votre organisation l’autorise.

De l'entrée au résultat

Un exemple détaillé

Voyez comment un contexte concret transforme cette recette en résultat utilisable.

Entrée réelle

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.

Exemple de sortie

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.

Pourquoi cela fonctionne

  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.

Vérifier le résultat

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

Utilisez-la en toute confiance

Questions fréquentes

Des réponses pratiques sur le bon moment pour utiliser cette recette, ce qu’il faut fournir et les cas où une vérification humaine reste nécessaire.

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.

Plus de façons d'explorer

Où se situe cette recette

Faites avancer votre travail