ARRAY.SORT function

This article describes the formula syntax of the ARRAY.SORT function.


Sort _count elements of array in increasing (_count >= 0) or decreasing (n < 0) order.


ARRAY.SORT(array, _count)

array is an array or handle to an array to sort
_count is an optional number of elements to partial sort. Default is 0.

Sort all elements of array in increasing numerical order when _count = 0. If_count = -1 sort in decreasing order. If _count > 0 only sort the smallest _count values. If _count < -1 only sort the largest -_count values. If array is not a row or column then partial elements of the last row are set to \(\infty\) or \(-\infty\) if the sort is increasing or decreasing, respecively.

If array is a handle return a handle to the sorted array.