Module 13 · Dynamic Arrays · Best sellers first

Nadia Rahman runs Inkwell Books and loves data

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.

Loading the spreadsheet…

Module 13 · Dynamic Arrays

Best sellers first

Nadia Rahman, runs Inkwell Books and loves data
Nadia Rahman runs Inkwell Books and loves data

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

  1. 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

    1. Click cell F5.
    2. Type =SORT( and the table without the titles.
    3. Type the column number, -1 for high to low and a closing bracket.
    4. Press Enter.
    5. 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.

  2. 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

    1. Click cell J13.
    2. Type =SORTBY( and the range for the result.
    3. Type the range to sort by and a closing bracket.
    4. 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.