SORT |
SORT(array [,sort_index] [,sort_order] [,by_col]) |
Returns the array of data in a range that has been sorted. |
array | The range, or array to sort. |
sort_index | (Optional) The number indicating the row or column to sort by. |
sort_order | (Optional) The number indicating the desired sort order: 1 = for ascending order (default) -1 = for descending order |
by_col | (Optional) A logical value indicating the desired sort direction: True = to sort by column False = to sort by row (default) |
REMARKS |
* Added in Excel 2021. * This function is often used when you only want to sort by one column. * This function can create a Dynamic Array Formula. * If you want to sort by more than one column then you must supply array constants for the second and third arguments. * If "sort_index" is left blank, then 1 (first column) is used. * If "sort_index" is not numeric, then #NAME? is returned. * If "sort_order" is left blank, then 1 (ascending) is used. * If "by_col" is left blank, then False is used. * You can use the FILTER function to filter and sort your data. * You can use the SORTBY function to return an array of data that has been sorted. * You can use the UNIQUE function to return an array of unique values from a list, table or cell range. * For the Microsoft documentation refer to support.microsoft.com |
|
1 - Sort all the rows in the range "B1:C4" by column 1, in ascending order. 2 - Sort all the rows in the range "B1:C4" by column 1, in ascending order. 3 - Sort all the rows in the range "B1:C4" by column 1, in descending order. 4 - Sort all the rows in the range "B1:C4" by column 2, in ascending order. 5 - Sort all the rows in the range "B1:C4" by column 2, in descending order. 6 - Sort all the rows in the range "B1:C4" by column 1, ascending AND by column 2, descending. 7 - Show all the rows in the range "B1:C4", where column "C" has a value less than 25, sorted by column 2, in ascending order. 8 - If the "sort_index" is not numeric, then #NAME? is returned. |
© 2022 Better Solutions Limited. All Rights Reserved. © 2022 Better Solutions Limited Top