SORT Function Explained

The SORT function in Microsoft Excel allows users to quickly and easily sort a range of cells in ascending or descending order. It takes up to three arguments: the range of cells to sort, the sort order (ascending or descending), and an optional sort by column. The function returns a sorted range of cells.

SORT Function Syntax

SORT(array, [sort_index], [sort_order], [by_col])

  • array: The range of cells or array to sort.
  • sort_index: (optional) The index of the column to sort by. The default is 1.
  • sort_order: (optional) The order to sort by. 1 for ascending (A-Z, 0-9) and -1 for descending (Z-A, 9-0). The default is 1.
  • by_col: (optional) Whether to sort by rows (0) or columns (1). The default is 0.