SORTBY

SORTBY Function Explained

SORTBY function is used for dynamically sorting excel ranges by the values of other ranges.

It is part of the Excel Dynamic Array Formulas. This is a group of formulas which allows the user to type a formula in a single cell, and receive a result in a whole range.

It is important to note that as of December 2019, this function is not yet available on Excel desktop, and is only available on Excel Online and for Office Insiders. But why wait when you can already practice it? 🙂

Example

Syntax

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

array – What is the range we would like to sort. This range can be a single column or multiple columns.

by_array1 – What is the range which our range will be sorted by.

[sort_order1] – How should the range be sorted. Use 1 for ascending order, and -1 for descending order. The default option is ascending.

We can sort our range by more than one array, if needed:

[by_array2] – The second range which will be used for sorting our range

[sort_order2] –  How should the range be sorted. Use 1 for ascending order, and -1 for descending order. The default option is ascending.

And so on…

Practice SORTBY function online

Exercise 1 – Basic Sort

 Exercise 2 – Advanced Sort by multiple columns