ExcelFormulas logoExcelFormulas.
Chiedi all'IA
Ricerca e riferimentoVerificato da QA

CERCA.X (XLOOKUP).

Cerca un valore in un intervallo o matrice e restituisce l'elemento corrispondente da un secondo intervallo.

Ricerca e riferimento
ExcelExcel 365Excel 2021Google Sheets

Come funziona nel dettaglio.

CERCA.X è una funzione fondamentale di Excel. Cerca un valore in un intervallo o matrice e restituisce l'elemento corrispondente da un secondo intervallo. Consente di velocizzare la gestione dei fogli di calcolo, ridurre gli errori e creare report automatizzati professionali.

💡 In parole semplici.

Searches for a value in one list (lookup array) and returns matching information from another list (return array) in the exact same row.

Analogia di tutti i giorni

"Think of XLOOKUP like looking up a word in a dictionary. You have a search word (Employee ID), you scan the dictionary list (ID Column), and you get the corresponding definition (Department Column)."

Sintassi.

Notazione Ufficiale Excel
=CERCA.X(valore; matrice_ricerca; matrice_restituita; [se_non_trovato]; [modalità_confronto])
Consiglio: Gli argomenti tra parentesi quadre [come_questo] sono facoltativi; tutti gli altri sono obbligatori.

Argomenti.

Di seguito l'elenco dettagliato di tutti i parametri accettati da questa funzione.

lookup_valueObbligatorio

The value you want to search for.

Valore d'esempio: D2
lookup_arrayObbligatorio

The range or array to search in.

Valore d'esempio: A2:A6
return_arrayObbligatorio

The range or array to return values from.

Valore d'esempio: B2:B6
if_not_foundFacoltativo

Text or value to return if no match is found.

Valore predefinito: "Not Found"
match_modeFacoltativo

0 = Exact match (default), -1 = Exact or next smaller, 1 = Exact or next larger, 2 = Wildcard match.

Valore predefinito: 0
search_modeFacoltativo

1 = Search first-to-last (default), -1 = Search last-to-first, 2 = Binary search (sorted asc), -2 = Binary search (sorted desc).

Valore predefinito: 1

Esempio pratico.

Scenario di utilizzo

Department Directory Lookup

Retrieve an employee's Department by searching their Employee ID.

Emp IDDepartmentSalarySearch IDResult Dept
101Engineering105000103—
102Marketing88000——
103Sales95000——
Formula applicata
=XLOOKUP(D2, A2:A6, B2:B6, "Not Found")
Risultato atteso::Sales

Evaluates XLOOKUP over the sample table cells, placing the verified output in cell E2.

Generatore di formula.

Apri Procedura Guidata Completa

Compila i campi qui sotto per creare una formula personalizzata pronta da incollare nel tuo foglio di calcolo.

Generated FormulaPronta da copiare

Caratteristiche del risultato.

Returns "Sales" based on sample evaluation criteria and active cell references.

Esempio di output::Sales
Tipo di dato restituito::Text

Migliori Pratiche

  • Use XLOOKUP to return multiple items simultaneously by selecting a multi-column return range.
  • Unlike VLOOKUP, XLOOKUP does not break when columns are inserted or deleted in the spreadsheet.
  • Leave match_mode blank if you want an exact match, which is what is needed 95% of the time.

Errori Più Frequenti

  • XLOOKUP is only available in Excel 365, Excel 2021, and Excel for the Web. It will return a #NAME? error in older versions.
  • Ensure the lookup_array and return_array are of equal length; otherwise, XLOOKUP returns a #VALUE! error.
Matrice di Compatibilità

Compatibilità per programma e versione.

Verifica tecnica eseguita sui motori di calcolo ufficiali di Microsoft Excel e Google Fogli.

Excel✓
Supportato
Excel 365✓
Supportato
Excel 2021✓
Supportato
Excel 2019✕
No
Google Sheets✓
Supportato
Disponibilità e versioni di Excel

Introduced in Excel 365 and Excel 2021. Not supported in Excel 2019 or Excel 2016 (#NAME? error).

Note su Google Fogli

Fully supported in Google Sheets with identical parameters, default exact match, and search modes.

Domande frequenti.

Domande Tecniche
Can XLOOKUP look up values to the left?↓

Yes. Unlike VLOOKUP which requires the return column to be to the right of the lookup column, XLOOKUP uses separate lookup_array and return_array ranges, allowing you to return data located in any column or row.

What is the primary difference between XLOOKUP and VLOOKUP?↓

XLOOKUP defaults to an exact match (VLOOKUP defaults to approximate match), does not break when columns are inserted into the table, handles missing values gracefully with the if_not_found parameter, and supports both vertical and horizontal searches.

Why does XLOOKUP return a #VALUE! error?↓

The #VALUE! error in XLOOKUP happens when lookup_array and return_array have incompatible dimensions (for example, a 5-row lookup range paired with an 8-row return range). Ensure both arrays cover the exact same number of rows or columns.