Module 13 · Dynamic Arrays
Best sellers first

Book week is close. Nadia wants a best seller table by the door and a sale table at the back. The sales list is in the order of the shop system. She wants sorted lists that stay sorted when the numbers change.
Steps
Sort a table with SORT
SORT returns a range in a new order. The second argument is the column to sort by. The third argument is the order: 1 for low to high, -1 for high to low.
How to do it
- Click cell F5.
- Type =SORT( and the table without the titles.
- Type the column number, -1 for high to low and a closing bracket.
- Press Enter.
- To leave out an argument, type two commas: =SORT(D5:D16,,-1) sorts one column high to low.
=SORT(B5:D16,3,-1)Task: Sort the reading night list by tickets, the most tickets first. Put it in cell M5.
Sort by another column with SORTBY
SORTBY sorts one range by the values of another range. The sort column does not have to be in the result.
How to do it
- Click cell J13.
- Type =SORTBY( and the range for the result.
- Type the range to sort by and a closing bracket.
- Press Enter.
=SORTBY(B5:B16,C5:C16)Task: Slow sellers go on the sale table. In cell M13, list the titles by sales, the lowest sales first.