In this worksheet, we have a list of names, projects, values, and regions.

This data is not sorted.

Lets start with the SORTBY function.

Now, the SORTBY function is designed to sort data by more than one dimension at the same time.

A dimension can be a corresponding column, a range of cells, or an array.

For both SORT and SORTBY functions,sort_orderis 1 for ascending order, and -1 for descending order.

In this example, we sort first by region, in ascending order.

Then we sort by name, also in ascending order.

Finally, we sort by amount, this time indescendingorder, so I need to provide a -1.

When I enter the formula, the data is sorted as needed.

Now lets look at how to perform the same sort with theSORT function.

Array is the same as before, the range B5:E16.

However, the trick is to use what’s called anarray constant.

Inside curly brackets, we enter 4 for region, 1 for name, and 3 for amount.

Here we’re specifying the columns we want to sort by.

So, which function should you use?

In this case, it’s a matter of personal preference.

Either function works fine.

The SORTBY option is more typical, and probably a bit easier to understand for the average user.

Both functions are dynamic and will respond to any changes in the source data.