ExcelFormulas logoExcelFormulas.
Chiedi all'IA
Google SheetsVerificato da QA

QUERY.

Runs Google Visualization API SQL-like queries on data tables.

Google Sheets
Google Sheets

Come funziona nel dettaglio.

QUERY è una funzione fondamentale di Excel. Runs Google Visualization API SQL-like queries on data tables. Consente di velocizzare la gestione dei fogli di calcolo, ridurre gli errori e creare report automatizzati professionali.

Sintassi.

Notazione Ufficiale Excel
=QUERY(data, query, [headers])
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.

dataObbligatorio

The cell range to query.

Valore d'esempio: A1:C5
queryObbligatorio

SQL-like query string enclosed in quotation marks.

Valore d'esempio: "SELECT A, C WHERE C > 150"

Esempio pratico.

Scenario di utilizzo

High Value Orders Query

Extract products where sales exceed 150.

ProductRegionSalesQuery OutputOutput Sales
Widget AEast100——
Widget BWest300——
Widget CEast250——
Formula applicata
=QUERY(A1:C5, "SELECT A, C WHERE C > 150", 1)
Risultato atteso::Widget B

Evaluates QUERY over the sample table cells, placing the verified output in cell D2.

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 "Widget B" based on sample evaluation criteria and active cell references.

Esempio di output::Widget B
Tipo di dato restituito::Text

Migliori Pratiche

  • Use uppercase keywords like SELECT and WHERE for readability.

Errori Più Frequenti

  • Google Sheets QUERY requires data in each column to be consistently typed (avoid mixing numbers and text).
Matrice di Compatibilità

Compatibilità per programma e versione.

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

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

Not supported in Microsoft Excel. QUERY is a proprietary Google Sheets function that uses Google Visualization API SQL syntax.

Note su Google Fogli

Native Google Sheets formula. Runs pseudo-SQL queries over sheet ranges for filtering, aggregation, and grouping.

Domande frequenti.

Domande Tecniche
Can I use QUERY across different worksheets in Excel?↓

Yes. You can reference cells located on other sheets by including the sheet name followed by an exclamation mark, for example: =QUERY(Sheet2!A2:A10). If the sheet name contains spaces, enclose it in single quotes: ='Q1 Report'!A2:A10.

What is the most common reason for errors in QUERY?↓

Google Sheets QUERY requires data in each column to be consistently typed (avoid mixing numbers and text).

Does QUERY work in Microsoft Excel?↓

No. QUERY is a proprietary Google Sheets function and is not supported in Microsoft Excel. Recommended Excel alternative: For Microsoft Excel, use the FILTER function (Excel 365 / 2021), SUMIFS/COUNTIFS, or Power Query (Get & Transform).