# Quantile - Sample Quantile

Returns the sample p-quantile of the non-missing observations (i.e. divides the sample data into equal parts determined by the percentage p).

## Syntax

Quantile(X, p)

X is the input data sample (one/two dimensional array of cells (e.g. rows or columns))

p is a scalar value between 0 and 1.

## Remarks

1. The time series may include missing values (e.g. #N/A, #VALUE!, #NUM!, empty cell), but they will not be included in the calculations.
2. The Quantile function for any distribution is defined between 0 and 1. Its function is the inverse of the cumulative distribution function (CDF).
3. The Quantile function returns the sample median when $p=0.5$.
4. The Quantile function returns the sample minimum when $p=0$.
5. The Quantile function returns the sample maximum when $p=1$.
6. For any probability distribution, the following holds true for the probability $p$ :

$$P(X\lt q)\geq p$$
Where
• $q$ is the sample $p$-quantile

## Examples

Example 1:

 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
A B
Date Data
1/1/2008 #N/A
1/2/2008 -1.28
1/3/2008 0.24
1/4/2008 1.28
1/5/2008 1.20
1/6/2008 1.73
1/7/2008 -2.18
1/8/2008 -0.23
1/9/2008 1.10
1/10/2008 -1.09
1/11/2008 -0.69
1/12/2008 -1.69
1/13/2008 -1.85
1/14/2008 -0.98
1/15/2008 -0.77
1/16/2008 -0.30
1/17/2008 -1.28
1/18/2008 0.24
1/19/2008 1.28
1/20/2008 1.20
1/21/2008 1.73
1/22/2008 -2.18
1/23/2008 -0.23
1/24/2008 1.10
1/25/2008 -1.09
1/26/2008 -0.69
1/27/2008 -1.69
1/28/2008 -1.85
1/29/2008 -0.98

Formula Description (Result)
=Quantile($B$2:$B$30,0.5) Sample median (-0.69)
=Quantile($B$2:$B$30,0) Sample minimum (-2.18)
=Quantile($B$2:$B$30,1) Sample maximum (1.73)