ExcelFormulas logoExcelFormulas.
Demander à l'IA
Tableaux dynamiquesVérifié par QA

SORTBY.

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

Tableaux dynamiques
ExcelExcel 365Excel 2021Google Sheets

Fonctionnement détaillé.

SORTBY est une fonction indispensable d'Excel. Sorts a range based on values in a separate range or array. Elle permet d'automatiser vos tableaux, fiabiliser vos calculs et gagner un temps précieux au quotidien dans vos feuilles de calcul.

Syntaxe.

Notation Standard Excel
=SORTBY(array, by_array1, [sort_order1], ...)
Conseil : Les arguments entre crochets [comme_ceci] sont facultatifs ; tous les autres sont obligatoires.

Arguments.

Détail de l'ensemble des paramètres acceptés par cette fonction.

arrayObligatoire

The range to sort and return.

Exemple : A2:A5
by_array1Obligatoire

The criteria range to sort by.

Exemple : B2:B5
sort_order1Facultatif

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

Défaut : 1

Exemple pas à pas.

Cas d'usage concret

Order Roster - Sort Names by Score

Extract only product names, sorted by their revenue column.

ProductRevenueSorted List
Product A120—
Product B500—
Product C310—
Formule appliquée
=SORTBY(A2:A5, B2:B5, -1)
Résultat attendu ::Product B

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

Générateur de formule.

Ouvrir l'assistant complet

Personnalisez les champs ci-dessous pour générer une formule prête à être copiée dans votre classeur.

Generated FormulaPrête à copier

Nature du résultat produit.

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

Exemple produit ::Product B
Type de sortie ::Text

Bonnes Pratiques

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

Erreurs à Éviter

  • The by_array must have the exact same number of rows as the target array or #VALUE! occurs.
Matrice de Compatibilité

Compatibilité par logiciel et version.

Vérification effectuée selon les moteurs de calcul officiels de Microsoft et Google.

Excel✓
Pris en charge
Excel 365✓
Pris en charge
Excel 2021✓
Pris en charge
Excel 2019✕
Non
Google Sheets✓
Pris en charge
Historique des versions Excel

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

Notes de compatibilité Google Sheets

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

Questions fréquentes.

Questions Techniques
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.