Build an XLOOKUP between Excel sheets

Autor: AILesson5 min de configuraçãoTestado com:ChatGPTRevisado em: 2026-08-28

Resposta rápida

Join two sheets with an explicit key, match rule, and no-match behavior. Forneça: Target sheet, Source sheet, Match and exception rules. Resultado esperado: A verified lookup formula plus duplicate and data-quality checks.

1

Adicione seu contexto

Seu texto permanece neste navegador. O AILesson Prompts não o envia para um modelo ou servidor.

2

Seu prompt

Campos não preenchidos permanecem visíveis como marcadores de posição, para que você ainda possa copiar e editar o prompt

Create an Excel XLOOKUP for these sheets.

Target sheet:
[target]

Source sheet:
[source]

Match and exception rules:
[rules]

Before writing the formula, confirm the lookup key, return field, exact-versus-approximate match, and whether the source key is unique. Do not silently choose the first duplicate. Return:
1. Formula for the first target row
2. Explanation of every XLOOKUP argument
3. Blank and no-match behavior
4. Checks for text/number mismatch, whitespace, and duplicate keys
5. Four test cases and expected results
6. A structured-reference version if both ranges are Excel Tables.
Experimente no Playground
Privado por padrãoA montagem do prompt acontece localmente no seu navegador. Evite colocar informações confidenciais em qualquer serviço de IA, a menos que sua organização permita.

Da entrada ao resultado

Um exemplo prático

Veja como um contexto concreto transforma esta receita em um resultado útil

Entrada real

Target sheet
Orders sheet: A is Order ID, B is Customer ID, and F should contain Customer Segment. Data starts at row 2.
Source sheet
Customers sheet: A contains unique Customer ID values and D contains Customer Segment. Headers are in row 1.
Match and exception rules
Use exact matching. Blank Customer ID should return blank. Unknown IDs should display 'Review'. Duplicate IDs in Customers are data errors and must be reported rather than silently accepted.

Exemplo de saída

Confirmed mapping: Orders!B2 is the lookup value; Customers!A:A is the lookup array; Customers!D:D is the return array. Customer ID must be unique and the match is exact.

Formula for Orders!F2 =IF(B2="","",XLOOKUP(B2,Customers!$A:$A,Customers!$D:$D,"Review",0))

The outer IF preserves blank input rows. XLOOKUP searches B2 in the fixed customer-ID column, returns the same row from column D, displays “Review” when no match exists, and uses match mode 0 for exact matching. The dollar signs keep source columns fixed when copied.

Data checks: Compare ISTEXT/ISNUMBER on both ID columns; test trimmed lengths; use =COUNTIF(Customers!$A:$A,A2) in a helper column and investigate results above 1.

Tests: known ID → stated segment; blank ID → blank; unknown ID → Review; duplicate source ID → flag in the helper check before trusting the lookup.

Table version: =IF([@[Customer ID]]="","",XLOOKUP([@[Customer ID]],Customers[Customer ID],Customers[Customer Segment],"Review",0)).

Por que isso funciona

  1. 1

    Naming both sides of the join prevents swapped lookup and return arrays.

  2. 2

    Duplicate-key checks prevent a syntactically valid formula from returning an arbitrary record.

Verifique o resultado

  • Is the source key unique for the intended business meaning?

  • Are lookup values and source keys stored using the same type and normalization?

  • Does a known no-match row return the intended visible result?

Use com confiança

Perguntas frequentes

Respostas práticas sobre quando usar esta receita, o que fornecer e onde a revisão humana ainda é importante

What should I prepare before using “Build an XLOOKUP between Excel sheets”?

For “Build an XLOOKUP between Excel sheets,” prepare Target sheet, Source sheet, and Match and exception rules. 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 “Build an XLOOKUP between Excel sheets” result not ready to use?

The result is not ready if it does not yet deliver the stated outcome—A verified lookup formula plus duplicate and data-quality checks—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 “Build an XLOOKUP between Excel sheets”?

The published test record for “Build an XLOOKUP between Excel sheets” 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.

Mais maneiras de explorar

Onde esta receita se encaixa

Mantenha o trabalho em andamento