# Quartile calculator Q1, Q3

### Quartile

In statistics, a quartile, a type of quantile, is three points that divide sorted data set into four equal groups (by count of numbers),
each representing a fourth of the distributed sampled population.

There are three quartiles: the first quartile (Q1), the second quartile (Q2), and the third quartile (Q3).

The first quartile (lower quartile, QL), is equal to the 25th percentile of the data. (splits off the lowest 25% of data from the highest 75%)

The second (middle) quartile or median of a data set is equal to the 50th percentile of the data (cuts data in half)

The third quartile, called upper quartile (QU), is equal to the 75th percentile of the data. (splits off the lowest 75% of data from highest 25%)

### How we calculating quartiles?

We sort set of data with n items (numbers) and pick n/4-th item as Q1, n/2-th item as Q2 and 3n/4-th item as Q3 quartile.
If indexes n/4, n/2 or 3n/4 aren't integers then we use interpolation between nearest items.

For example, for n=100 items, the first quartile Q1 is 25th item of ordered data, quartile Q2 is 50th item and quartile Q3 is 75th item. Zero quartile Q0 would be minimal item and the fourth quartile Q4 would be the maximum item of data, but these extreme quartiles are called minimum resp. maximum of set.