The quartiles are three numbers that split our data into precisely four equal parts. They are the lower quartile (Q_{1}), the median (Q_{2),} and the upper quartile (Q_{3}). The procedure to find the quartiles is different depending on whether the number of data values (denoted by N) is even or odd.

**Quartiles for Odd Number of Data:**

- Arrange the data in ascending order.
- The middlemost term in the data set is the median (the second quartile Q
_{2}). The middlemost term is the [(N+1)/2]^{th}term. - Split the data set into two equal halves at the median. Since N is odd, include the median in both the upper and lower halves of the data set.
- The median of the lower data set gives us the lower quartile (Q
_{1}). - The median of the upper half gives us the value of the upper quartile (Q
_{3}).

**Example 1**:

Consider the following set of data values: 1, 2, 4, 5, 6, 7, 9, 11, 12.

Here the number of data values is equal to N = 7 (odd). The data is already in ascending order therefore the median is given by the [(7+1)/2]^{th} term = 4th term which is 6. So we conclude that,

Median = Second Quartile = Q_{2} = 6.

We now divide the data set into two halves including the median in both data sets.

** Lower half of the data set**: 1, 2, 4, 5, 6.

Clearly, the median/middlemost term of the lower data set is 4. So we conclude that,

Lower Quartile = Q_{1} = 4.

** Upper half of the data set**: 6, 7, 9, 11, 12.

The middlemost term of the upper data set is 9. So we conclude that,

Upper Quartile = Q_{3 }= 9.

**Quartiles for Even Number of Data:**

- Arrange the data in ascending order.
- Since N is even there are two terms lying exactly in the middle of the data values. They are the [N/2]
^{th}term and the [(N/2)+1]^{th}term. The average of the two middlemost terms gives us the value of the median (second quartile). - Since N is even, the data values split into exactly two equal halves. The lower half and upper halves each contain (N/2) terms.
- The median of the lower data set gives us the lower quartile and the median of the upper half gives us the value of Q
_{3}.

**Example 2**:

Consider the following set of data values: 29, 32, 37, 39, 42, 44, 48, 53.

The two middlemost terms are the [N/2]^{th} term and the [(N/2)+1]^{th} term, that is the 4^{th} and 5^{th} terms. The average of these two terms gives us the median.

Median = Second Quartile = Q_{2} = Average of 39 and 42 = (39+42)/2 = 40.5.

We now divide the data set into two halves. Each half contains exactly 4 data values.

** Lower half of the data set**: 29, 32, 37, 39.

Lower Quartile = Q_{1} = Median of Lower Data Set = Average of 32 and 37 = 34.5.

** Upper half of the data set**: 42, 44, 48, 53.

Upper Quartile = Q_{3 }= Average of 44 and 48 = (44+48)/2 = 46.