Investment Studio > Expressions > Functions > Statistical > PERCENTILE

float percentile(float array data, float left_alfa)

Returns the left alfa percentile, i.e. the value such that a fraction left_alfa of all values in data is < value.

All elements in data are converted to floats, with exclusion if conversion fails.

left_alfa must be in the range [0, 1]. If it's not a multiple of 1 / (N - 1), where N is the number of values in data, linear interpolation is used to determine the value at the specified percentile.

Examples

=percentile({1, 2, 3, 4, 5}, 75%)

returns 4: 75% of all values in the argument array are < 4; values > 4 are said to be above the 75th percentile.

=percentile({1, 2, 3, 4, 5, 6, 7, 8, 9}, 80%)

returns 7.4 (linear interpolation used since 80% = 0.8 is not a multiple of 1 / (9 - 1)).

See also average, count, frequency, geomean, harmean, large, max, median, min, percentrank, quartile, rank, small, trimmean.