SMALL (Values, N) SMALL (Values; N)

Values

The array from which the n th smallest value is returned.

N

Number Number

The position of the value to return, in a version of the given array sorted in ascending order.

Returns

The n th smallest value in the given array, where n is given as the second parameter.

Returns the n th smallest value in the given array, where n is given as the second parameter.

An array of temporal values is also accepted, in which case the n th earliest temporal value is returned.

Examples

SMALL ({ 22, 5, 3, 14 }, 2)
SMALL ({ 22; 5; 3; 14 }; 2)

Returns 5, which is the second smallest number in the { 22, 5, 3, 14 }{ 22; 5; 3; 14 } array.

INDEX ( SORT ({ 22, 5, 3, 14 }, SortOrder.Ascending), 2)
INDEX ( SORT ({ 22; 5; 3; 14 }; SortOrder,Ascending); 2)

Returns 5, which is the second smallest number in the { 22, 5, 3, 14 }{ 22; 5; 3; 14 } array. This formula is equivalent to SMALL ({ 22, 5, 3, 14 }, 2) SMALL ({ 22; 5; 3; 14 }; 2). It first sorts the array in ascending order, resulting in the array { 3, 5, 14, 22 }{ 3; 5; 14; 22 }, and then selects the second element of that array.

fxEngine Shell Want this in your own terminal? A standalone version is coming. Get notified.
Loading fxEngine Shell