Quartiles | Formula, Definition and Solved Examples
Last Updated : 21 Apr, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report
Quartiles divide a data set into four equal parts, each containing 25% of the data. They help to understand the spread and center of the data. As an important concept in statistics, quartiles are used to analyze large data sets by highlighting values near the middle. This method is particularly useful for identifying outliers and comparing different data sets.
There are three quartiles:
Lower or First Quartile (Q1)
Quartile 1 lies between the starting term and the middle term.
This is the median of the lower half of the data set.
It is also known as the 25th percentile because it marks the point where 25% of the data is below it.
Median or Second Quartile (Q2)
Quartile 2 lies between the starting terms and the last terms, i.e., the Middle term.
This is the median of the entire data set.
It is also known as the 50th percentile, as it divides the data into two halves.
Upper or Third Quartile
Quartile 3 lies between quartile 2 and the last term.
This is the median of the upper half of the data set.
It is also known as the 75th percentile because it marks the point where 75% of the data is below it.
Quartile Formula
As mentioned above, Quartile divides the data into 4 equal parts. There is a separate formula for finding each quartile value, and the steps to obtain the quartile formula are as shown below as follows:
Step 1: Sort the given data in ascending order.
Step 2: Find respective quartile values/terms as per need from the below formulae.
First Quartile = \frac{(n + 1)}{4} \text{\small th term}
Second Quartile = \frac{(n + 1)}{2} \text{\small th term}
Third Quartile = \frac{3(n + 1)}{4} \text{\small th term}
Where n is the total number of values in the dataset.
Let's understand the topic better with a solved example.
For Example: Find the Q1, Q2, and Q3 of the given dataset: 3, 5, 7, 8, 10, 11, 3, 1, 1, 11.
Solution:
Arrange the dataset in ascending or descending order, depending on your preference. We will arrange the data in ascending order: 1, 3, 3, 5, 7, 8, 10, 11, 11
Cut the list into Quarters: (n = number of terms)
Quartile 1 (Q1) = [(n + 1)/4] th Term = [( 9+ 1) / 4] = 2.25 term [Rounds off to 3 term] = 3
Quartile 2 (Q2) = [(n + 1)/2 ] th Term = [{9 + 1)/2] = 5 th Term = 7
Quartile 3 (Q3) = [3(n + 1)/4 ] th Term = [3 (10 + 1)/4] th Term = 7.5 th Term [Rounds off to 8 th Term] = 11
Quartile Ranges of the given Dataset
Quartiles in Statistics
We know that the Median divides the data into two equal parts; in the same way, the quartile divides the data into four parts. Similar to the median, which divides the data into half so that 50% of the data lies below the median and 50% lies above it, the quartile splits the data into, i.e..
First Part: From smallest to largest of numbers, 25% of the value comes under this part ,and also this part lies below the first quartile.
Second Part: Value between 25% and 50% of the data comes under this part, and this part lies between the first and second quartile (Median).
Third Part: Value between 50% and 75% of the data comes under this part, and this part lies between the second and third quartile.
Fourth Part: The Greatest 25% of all values in the data comes under the fourth part, and this part lies above the fourth quartile.
Interquartile Range is the distance between the first quartile and the third quartile. It is also known as a mid-spread. It helps us to calculate variation for the data, which is divided into quartiles. The formula for calculating the Interquartile range is given by,
Interquartile Range (IQR) = Q3 - Q1
Where,
Q3 is the third/upper quartile, and
Q1 is the first/lower quartile.
Quartile Deviation
Quartile Deviation is defined as half of the distance between the first quartile and the third quartile. It is also known as the semi-interquartile range. The formula for quartile deviation is given by,
Quartile Deviation =(Q3 - Q2)/2
Quartile vs Percentile
The key differences between Quartile and Percentile are given as follows:
Aspect
Quartile
Percentile
Definition
A quartile is a type of quantile that divides a data set into four equal parts
A percentile is a type of quantile that divides a data set into 100 equal parts
Range
Quartiles divide a dataset into four parts:
Q1 = 25th Percentile
Q2 = 50th Percentile or Median
Q3 = 75th Percentile
Percentiles divide a dataset into 100 parts, with each percentile representing 1% of the data.
Calculation
Quartiles are calculated by dividing the data set into four equal parts, with each part containing 25% of the data.
Percentiles are calculated by dividing the data set into 100 equal parts, with each part containing 1% of the data. a
Represented by
Quartiles are often represented as Q, Q2, and Q3.
Percentiles are often represented as P1, P2, P3, and so on up to P99
Usefulness
Quartiles are useful for identifying the spread and distribution of data, particularly in box plots and histograms.
Percentiles are useful for comparing an individual data point to the rest of the data set and for identifying extreme values or outliers.
Problem 1: Find Quartile 1 for the given data:10, 30, 5, 12, 20, 40, 25, 15, 18.
Solution:
Step 1: Sort the given data in ny order ( ascending order / descending order) 5, 10, 12, 15, 18, 20, 25, 30, 40
Step 2: Find 1st Quartile FIrst Quartile = (\frac{n + 1}{4})^{th} term
Here n = 9 because there are total 9 numbers in the given data. ⇒ First Quartile = ((9 + 1)/4)th term ⇒ First Quartile = (10/4)th term ⇒ First Quartile = 2.5th term
Now, 2.5th term = 2nd term + (0.5) (3rd term - 2nd term) ⇒ 2.5th term = (10) + (0.5) (12 - 10) ⇒ 2.5th term = 10+1 ⇒ 2.5th term = 11
The First Quartile value is 11.
Problem 2: Find the Second Quartile for the data 10, 30, 5, 12, 20, 40, 25, 15, 18.
Solution:
Step 1: Sort the given data in the ascending order
5, 10, 12, 15, 18, 20, 25, 30, 40
Step 2: Find 2nd Quartile
Second Quartile = (\frac{n + 1}{2})^{th} term
Here n = 9 because there are total 9 numbers in the given data. ⇒ Second Quartile = (\frac{9 + 1}{2})^{th} term ⇒ Second Quartile = (10/2)th term ⇒ Second Quartile = 5th term 5th term is 18
So the Second Quartile value is 18.
Problem 3: Find the third Quartile for the data 10, 30, 5, 12, 20, 40, 25, 15, 18.
Solution:
Step 1: Sort the given data in the ascending order 5, 10, 12, 15, 18, 20, 25, 30, 40
Step 2: Find 3rd Quartile Third Quartile = \frac{3(n + 1)}{4}^{th} term
Here n = 9 because there are total 9 numbers in the given data. ⇒ Third Quartile = \frac{3(n + 1)}{4}^{th} term ⇒ Third Quartile= \frac{3 \times (10)}{4}^{th} term ⇒ Third Quartile= 7.5th term
7.5th term is average result of 7th and 8th term = (25 + 30)/2 = 27.5 Remember: 7.5th term = 7th term + (0.5) (8th term - 7th term)
The most recommended method to find value is mentioned above Because the term not always N.5 something it may vary from N.1 to N.9 Here, N be any natural number.
So the third Quartile value is 27.5.
Problem 4: Find the first, second, and third quartiles for the data 8, 5,15, 20, 18, 30, 40, 25
Solution:
Step 1: Sort the given data in the ascending order
5, 8, 15, 18, 20, 25, 30, 40.
Step 2: Find all Quartiles step by step
First Quartile= {(n + 1)/4}th term
Here n = 8 because there are total 8 numbers in the given data.
⇒ First Quartile = {(8 + 1)/4}th term ⇒ First Quartile= {9/4})th term ⇒ First Quartile= 2.25th term
Thus, 2.25th Term = 2nd term + (0.25)(3rd term - 2nd term )
⇒ 2.25th Term = 8+(0.25)(15-8) = 9.75
First Quartile value is 9.75
Second Quartile = {(n + 1)/2}th term
⇒ Second Quartile = (9 + 1)/2}th term ⇒ Second Quartile = {10/2}th term ⇒ Second Quartile = 5th term
5th term is 20
So the second Quartile value is 20.
Third Quartile = 3(n + 1)/4th term
⇒ Third Quartile = (3(8 + 1)/4)th term ⇒ Third Quartile = (27/4)th term ⇒ Third Quartile = 6.75th term
Thus, 6.75th = 6th term +(0.75)(7th -6th)
⇒ 6.75th = 25+ (0.75)(5)= 28.75
So the third Quartile value is 28.75
Problem 5: What is the Interquartile Range for the data if the first quartile is 10 and the third quartile is 30cm?
Solution:
Given,
Q1 = 10
Q3 = 30
Interquartile range = Q3 - Q1 ⇒ Interquartile range = 30 - 10
Thus, Interquartile range is 20.
Problem 6: What is the Quartile Deviation for the data if the first quartile is 15 and the third quartile is 30cm?
Question 3: Given the dataset: 3, 8, 12, 17, 20, 24, 27, 31, compute Q1, Q2, and Q3.
Question 4: Data points: 1, 2, 2, 3, 4, 4, 5, 5, 6, 7, 100. Identify Q1, Q2, and Q3 and discuss how the outlier affects the quartile values.
Question 5: Test scores of 15 students: 55, 60, 61, 63, 67, 69, 72, 75, 78, 81, 83, 85, 88, 90, 92. Calculate Q1, Q2, and Q3 and interpret the results to understand the spread and distribution of the students' test scores.
Conclusion
Quartiles are statistical values that divide a dataset into four equal parts, each representing 25% of the data. They are essential in understanding the spread and distribution of data, particularly in large datasets. Quartiles help in identifying the central tendency, dispersion, and outliers within a dataset. The three quartiles are the first quartile (Q1), which marks the 25th percentile, the second quartile (Q2) or median, which marks the 50th percentile, and the third quartile (Q3), which marks the 75th percentile.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.