The SORT function
In Figure 10.13, I clicked on cell D3 and then clicked on Sort Largest to Smallest on the Data tab of Excel’s ribbon. The =SORT(B3:E12)
formula in cell G3 shows the list sorted back into alphabetical order again. In this case, the SORT
function is spilling results into columns H:J
and rows 4:12
:
Figure 10.13 – The SORT function
The SORT
function has the following arguments:
- Array – The range of cells that you wish to sort, which, in this case, is cells B3:E12.
Tip
Make sure that you don’t include your heading row in the array; otherwise, you’ll most likely sort the column headings into the body of your list.
- Sort_index – An optional column position that you wish to sort on. In this case, I omitted this argument, but I’ll show you an example later.
- Sort_order – This optional argument defaults to
1
, which indicates you want to sort in ascending order, or you...