SORTBY
Reorder one array using values from one or more corresponding arrays.
Syntax
=SORTBY(array, by_array1, [sort_order1], [by_array2, sort_order2], …)Worked example
Sort names by their paired scores, highest first.
=SORTBY({"Lee";"Ana";"Sam"},{30;20;40},-1)Result Sam; Lee; Ana (three rows)
Microsoft documentation
Check the arguments, supported editions and behavior of this function in Microsoft’s reference.
Microsoft referenceExcel SORTBY Function | Excel One Minute Functions Explained
Practice SORTBY
Sort names by their paired scores, highest first.
| A | B | |
|---|---|---|
| 1 | ||
| 2 | ||
| 3 | ||
| 4 | ||
| 5 | ||
| 6 | ||
| 7 | ||
| 8 |
Show example formula
=SORTBY(B2:B4,B5:B7,B8) Lesson quiz
Answer three questions to see your level in this lesson.
