What the name means | "Sort a range of numbers"
| Syntax | SortNum ( Values, [Direction] )
| Description | SortNum is an array function that sorts an 1 dimensional range of numbers, either in an ascending or descending sort.
| Array Function | This 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.
|
Defaults and Values The variable(s) of this function have certain defaults and/or switch values associated with them. Click here to see more. Type of Value | Value | Description | Detail | Default(s)
| Direction | 0 | Ascending | Switches
| Direction | 0 | Ascending
| | | 1 | Descending |
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. The variables affected are as follows (in order): Variable | Type of Handling | Explanation | Values | Trailing Blank Size (one range, and will not shorten to a range length less than 1) | If this range has trailing blanks (as opposed to zeros, a blank is a cell with nothing in it), the range will be shortened to the last non-blank element. | Values | Trailing Blank Size (one range, and will not shorten to a range length less than 1) | If this range has trailing blanks (as opposed to zeros, a blank is a cell with nothing in it), the range will be shortened to the last non-blank element. | Values | Trailing Zero Size (one range) | If this range has trailing zeros, the range will be shortened to last non-zero element. So {0,20,0,30,0,0} would be shortened to {0,20,0,30}. | Values | Trailing Zero Size (one range) | If this range has trailing zeros, the range will be shortened to last non-zero element. So {0,20,0,30,0,0} would be shortened to {0,20,0,30}. |
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
|
|