PERCENTILE(k, array)

The PERCENTILE function calculates the k-th percentile of the numbers in an array or range. k is a number from 0 to 1 inclusive (or 0% to 100%).

The k-th percentile P of a range of numbers is a number such that at least a proportion k of the range of numbers is smaller than or equal to P, and also at least a proportion (1 - k) of those numbers is larger than or equal to P.

For example

PERCENTILE(25%, {0, 1, 2, 3, 4})

returns 1.

PERCENTILE(25%, {1, 2, 3, 4})

returns 1.75.

See also:

Other statistical functions