Range Formula
The interquartile range (IQR) is a measure of variability, based on dividing a given set of data into quartiles, and thus leading to the range formula. Quartiles are the values that divide a list of numbers into quarters. While dividing an ordered set into equal quarters, the three values or cuts that divide each respective part are called the first, second, and third quartiles, denoted by Q1, Q2, and Q3, respectively.
 Q1 is the cut in the first half of the rankordered data set.
 Q2 is the median value of the set.
 Q3 is the cut in the second half of the rankordered data set.
Let's learn about the range formula with a few solved examples in the end.
What Is the Range Formula?
The range formula for a given set of data can be expressed as:
IQR = Q3  Q1
where,
IQR = Interquartile range
Q1 = First Quartile
Q3 = Third Quartile
First quartile, Q1 can be calculated using the formula:
Q1 = \( \dfrac{(n+1)}{4}^{\text{th}}\) term
The third quartile, Q3 can be calculated using the formula:
Q3 = \( \dfrac{3(n+1)}{4}^{\text{th}}\) term
where,
n = Number of terms
Note: The calculated values of quartiles using these formulas should be whole numbers. If not, round them off to the nearest integer value.
The second Quartile or Median of the ordered data set can be calculated using the median formula, which means:
IQR = Q2

Example 1:
Using the interquartile range formula, calculate the range of the following set of data:
{4, 17, 7, 14, 18, 12, 3, 16, 10, 4, 4, 11}
Solution:
To find: Interquartile range
Given:
Number of terms = 12
Set = {4, 17, 7, 14, 18, 12, 3, 16, 10, 4, 4, 11}
Ordered set = {3, 4, 4, 4, 7, 10, 11, 12, 14, 16, 17, 18}
Dividing the set into quartiles, each quarter will have 3 terms as: {3, 4, 4}, {4, 7, 10}, {11, 12, 14}, {16, 17, 18}
First Quartile,
Q1 = (4 + 4)/ 2 = 4
Third Quartile,
Q3 = (14 + 16)/2 = 15
Using Interquartile Range Formula,
IQR = Q3  Q1
= 15  4
= 11
Answer: Interquartile range of the given set = 11

Example 2:
Find the interquartile range for first ten even numbers: 2, 4, 6, 8, 10, 12, 14, 16, 18, 20?
Solution:
To find: Interquartile range of the given set
Given: Number of terms, n = 10
Median term,
Q2 = \( \dfrac{ \frac{n}{2}^{\text{th}} \text{term} + (\frac{n}{2} + 1)^{\text{th}} \text{term}}{2}\)
= (10 + 12)/ 2
= 11
Interquartile range = Q2 = 11
Answer: Interquartile range of the given set = 11