ExcelFormulas logoExcelFormulas.
Preguntar a IA
Google SheetsVerificado por QA

QUERY.

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

Google Sheets
Google Sheets

Cómo funciona.

QUERY es una función fundamental de Excel. Runs Google Visualization API SQL-like queries on data tables. Permite automatizar hojas de cálculo, simplificar fórmulas complejas y analizar datos con total precisión en Microsoft Excel y Google Sheets.

Sintaxis.

Notación Estándar de Excel
=QUERY(data, query, [headers])
Consejo: Los argumentos entre corchetes [como_este] son opcionales; todos los demás son obligatorios.

Argumentos.

A continuación se detallan todos los parámetros aceptados por esta función.

dataObligatorio

The cell range to query.

Ejemplo: A1:C5
queryObligatorio

SQL-like query string enclosed in quotation marks.

Ejemplo: "SELECT A, C WHERE C > 150"

Ejemplo práctico.

Caso de Uso Paso a Paso

High Value Orders Query

Extract products where sales exceed 150.

ProductRegionSalesQuery OutputOutput Sales
Widget AEast100——
Widget BWest300——
Widget CEast250——
Fórmula Aplicada
=QUERY(A1:C5, "SELECT A, C WHERE C > 150", 1)
Resultado Esperado::Widget B

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

Generador de fórmula.

Abrir Asistente Completo

Personaliza los campos de argumento a continuación para generar una fórmula lista para copiar y pegar en tu hoja de cálculo.

Generated FormulaLista para copiar

Comportamiento del resultado.

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

Resultado de Muestra::Widget B
Tipo de Salida::Text

Buenas Prácticas

  • Use uppercase keywords like SELECT and WHERE for readability.

Errores Frecuentes

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

Compatibilidad de plataforma y versiones.

Matriz verificada con base en los motores de cálculo oficiales de Microsoft Excel y Google Sheets.

Excel✕
No
Excel 365✕
No
Excel 2021✕
No
Excel 2019✕
No
Google Sheets✓
Compatible
Disponibilidad y Versiones de Microsoft Excel

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

Notas sobre Compatibilidad con Google Sheets

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

Preguntas frecuentes.

Dudas Técnicas
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).