SORTBY Function. Sort range of cells.(Microsoft Excel)


The SORTBY function is a Spill related function implemented in 2019.
It is a function to sort a given list in the order of specific columns.
It works similarly to sorting data.

How it works

=SORTBY(array, by_array1, sort_order1, ...)
arrayRequired argument.
Cell range to sort.
by_array1Specify a cell range of columns on which to base the sorting.
The number of optional, but one is required.
sort_order11Sort Order.
1: ascending order.
-1: descending order.


When you enter a formula, the sorted result of the array is displayed.
The result of the sorting will be displayed.

The function will automatically expand to cells other than the cell where the formula was entered, but cells other than the cell with the formula are ghost cells and cannot be edited.

The formula below is a formula to sort in ascending order by Type in column C and in descending order by Quantity in column D.


Comparison with other functions

SORT Function

The differences from the SORT function added at the same time are shown in the table below.

Sorting criteria1 column only.Multiple columns.
Specify columnsNumerics.Cell range.
Sort directionRow or column.Row only.


Microsoft Excel Functions Lookup & Reference