Home › Functions › Lookup & Reference › SORTBY
fx
SORTBY
Lookup & Reference  ·  Since: Microsoft 365  ·  9 languages

The SORTBY function sorts the contents of a range or array based on the values in a corresponding range or array.

🌐 Translations

English SORTBY
Deutsch SORTIERENNACH
Français TRIERPAR
Español ORDENARPOR
Italiano SORTBY
Português CLASSIFICARPOR
Nederlands SORTBY
Polski SORTBY
Русский СОРТПО

📦 Availability

Excel versionAvailable
Excel 2007 ✗
Excel 2013 ✗
Excel 2019 ✗
Excel 2021 ✗
Microsoft 365 ✓
Translate a formula with this function
fx EN
fx DE

⌨ Syntax

SORTBY(array,by_array1,[sort_order1],[by_array2,sort_order2],…)

Arguments

array (required) — The array or range to sort
by_array1 (required) — The array or range to sort on
sort_order1 (optional) — The order to use for sorting. 1 for ascending, -1 for descending. Default is ascending.
by_array2 (optional) — The array or range to sort on
sort_order2 (optional) — The order to use for sorting. 1 for ascending, -1 for descending. Default is ascending.

▶ Examples

=SORTBY(array,by_array1,[sort_order1],[by_array2,sort_order2],…)

Related functions

Copied to clipboard