SortNum array function

Range Operations category - Range Lookup family Home 
What the name means"Sort a range of numbers"
SyntaxSortNum ( Values, [Direction] )
DescriptionSortNum is an array function that sorts an 1 dimensional range of numbers, either in an ascending or descending sort.
Array FunctionThis function is an array function, returning an array of values as described in the description or narrative of this function. If you don't input as an array function (Ctrl-Shift-Enter in Excel) the first element of the array only wil be returned. Business Functions has a menu option 'Array Tools', which is helpful in expanding and collapsing array functions across ranges.
VariableType or ValueDescription
Inputs: (2)
1 Values Range of Floats (numbers) Range of Values
2 Direction Integer (Optional) Direction of search, sort or whatever. 0 for ascending, 1 for descending. (Optional)
Output:
Return Value Values Range of Floats (numbers) Range of Values
Defaults and Values

The variable(s) of this function have certain defaults and/or switch values associated with them. Click here to see more.

Range Handling and Constraints

This function has range inputs that are subject to range handling procedures to help reduce input errors and increase flexibility and speed. Click here to see more.

Whats good or unique about it
SortNum is one of the few ways to sort data with a single formula in Excel without using a macro or menu option. That means the sorted results can be 'live', responding to each calculation of your spreadsheet,
Methodology
SortNum uses the 'heap sort ' technique.
References
Robert Sedgewick, 1998, Algorithms in C++ Parts 1-4, ISBN 0-201035088-2
Examples
  • Preview of the SortNum example.
  • The above spreadsheet can be accessed from the Quick Reference (on the Business Functions menu), on the Examples menu, or in the Business Functions\Component Examples directory