ExcelFormulas logoExcelFormulas.
Preguntar a IA
Matrices dinámicasVerificado por QA

SORTBY.

Sorts a range based on values in a separate range or array.

Matrices dinámicas
ExcelExcel 365Excel 2021Google Sheets

Cómo funciona.

SORTBY es una función fundamental de Excel. Sorts a range based on values in a separate range or array. 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
=SORTBY(array, by_array1, [sort_order1], ...)
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.

arrayObligatorio

The range to sort and return.

Ejemplo: A2:A5
by_array1Obligatorio

The criteria range to sort by.

Ejemplo: B2:B5
sort_order1Opcional

1 for Ascending (default), -1 for Descending.

Valor por defecto: 1

Ejemplo práctico.

Caso de Uso Paso a Paso

Order Roster - Sort Names by Score

Extract only product names, sorted by their revenue column.

ProductRevenueSorted List
Product A120—
Product B500—
Product C310—
Fórmula Aplicada
=SORTBY(A2:A5, B2:B5, -1)
Resultado Esperado::Product B

Evaluates SORTBY over the sample table cells, placing the verified output in cell C2.

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

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

Buenas Prácticas

  • Can sort by multiple priority levels: =SORTBY(names, department, 1, salary, -1).

Errores Frecuentes

  • The by_array must have the exact same number of rows as the target array or #VALUE! occurs.
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✓
Compatible
Excel 365✓
Compatible
Excel 2021✓
Compatible
Excel 2019✕
No
Google Sheets✓
Compatible
Disponibilidad y Versiones de Microsoft Excel

Introduced in Excel 365 and Excel 2021. Not available in Excel 2019.

Notas sobre Compatibilidad con Google Sheets

Supported in Google Sheets (uses SORTN or standard SORT with external array keys).

Preguntas frecuentes.

Dudas Técnicas
Can I use SORTBY 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: =SORTBY(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 SORTBY?↓

The by_array must have the exact same number of rows as the target array or #VALUE! occurs.

Does SORTBY work identically in Google Sheets?↓

Yes, SORTBY is supported in both Microsoft Excel and Google Sheets with standard evaluation behavior.