Course Content
Excel Formulas
Excel Formulas
SORT
The SORT function in Excel is used to sort the contents of a range or array. It can sort data based on one or multiple columns, and it provides options to sort in ascending or descending order.
array | The range or array to sort. |
[sort_index] | (Optional) The column or row to sort by. The default is the first column or row. |
[sort_order] | (Optional) A number indicating the desired sort order; 1 for ascending (default) or -1 for descending. |
[by_col] | (Optional) A logical value indicating the direction of the sort; FALSE to sort by row (default) or TRUE to sort by column. |
It is really straightforward and simple. Just select the range, specify how you want to sort it, and you will get it sorted. It works on various types of data, including numbers, text, and even dates.
The SORT function can also sort data based on multiple columns. Suppose you have a dataset with names in column A and scores in column B, and you want to sort by scores first and then by names.
Note
To sort data in descending order, you can use the sort_order argument.
Everything was clear?