Skip to content
SPM Tuition
Mathematics · Dispersion of ungrouped data

Calculating range and interquartile range

You know the range is biggest minus smallest, but the quartile step keeps going wrong.

The range is the largest value minus the smallest. The interquartile range is the third quartile minus the first quartile, and it measures the spread of the middle half of the data.

This lesson opens dispersion of ungrouped data. The next lesson, finding variance and standard deviation, measures spread from the mean.

What is the quartile routine?

  1. Write the values in order, smallest first.
  2. Find the median Q2.
  3. Split the list into a lower half and an upper half.
  4. Q1 is the median of the lower half, and Q3 is the median of the upper half.

Worked example 1: an even number of values

Data: 12, 15, 9, 20, 18, 14, 11, 16. Sorted: 9, 11, 12, 14, 15, 16, 18, 20 (8 values).

The range is 20 − 9 = 11. The median is (14 + 15) ÷ 2 = 14.5. The lower half is 9, 11, 12, 14, so Q1 = (11 + 12) ÷ 2 = 11.5. The upper half is 15, 16, 18, 20, so Q3 = (16 + 18) ÷ 2 = 17.

The interquartile range is 17 − 11.5 = 5.5.

Worked example 2: an odd number of values

Data: 3, 5, 6, 8, 9, 12, 15 (7 values, already sorted). The median is the 4th value, 8.

Leaving the median out, the lower half is 3, 5, 6 and Q1 = 5. The upper half is 9, 12, 15 and Q3 = 12. The range is 15 − 3 = 12 and the interquartile range is 12 − 5 = 7.

When one value is extreme

Change the 15 to 45 in the second example: 3, 5, 6, 8, 9, 12, 45. The range becomes 42, a jump of 30. The quartiles are still Q1 = 5 and Q3 = 12, so the interquartile range is still 7.

This is why the interquartile range is preferred when an extreme value is present. The range reacts to the single large value, and the interquartile range ignores it.

The slips to avoid

The first slip is forgetting to sort, which makes the median wrong and everything after it. The second is taking Q1 as a quarter of the largest value instead of the median of the lower half.

A third is finding the interquartile range as Q3 + Q1. Write the subtraction on the page before filling in the numbers. Keep a note of the slip you make in the mistake log and paper-error review.

Check yourself

Find the range and interquartile range of 7, 2, 10, 4, 9, 5.

Answer

Sorted: 2, 4, 5, 7, 9, 10 (6 values). Range = 10 − 2 = 8.

Median = (5 + 7) ÷ 2 = 6. Lower half 2, 4, 5 gives Q1 = 4. Upper half 7, 9, 10 gives Q3 = 9.

Interquartile range = 9 − 4 = 5.

What to study next

Continue with finding variance and standard deviation. Check your quartiles on invented data using the descriptive statistics explorer.

For a teacher to go through both the even and odd cases with you, see online one-to-one Mathematics tuition.

Common questions

What is the range?

The range is the largest value minus the smallest value. It is quick to find, but it depends only on two values, so a single extreme value changes it. It says nothing about how the values in between are spread.

What is the interquartile range?

It is the third quartile minus the first quartile, so it measures the spread of the middle half of the data. Extreme values do not affect it, which makes it more stable than the range.

Why must I sort the data first?

Medians and quartiles are positions in an ordered list. An unsorted list gives the wrong middle. Write the ordered list on the paper and check that it has the same number of values as the original.

What do I do with the median when the count is odd?

Follow the convention of your class and apply it consistently. This page leaves the median out of both halves when the count is odd. Some books include it in both, so follow your textbook.

If the quartile step goes wrong whenever the count changes from even to odd, one-to-one lessons let a teacher walk through both cases on your own data until the split is automatic.

  • Online one-to-one lessons for your child with an experienced teacher.
  • Your first class is a one-hour trial, from RM50. The fee is agreed before you book.
  • Happy with the teacher? Continue with lessons of about 1.5 hours. If not, ask for another teacher.