How to Find the Interquartile Range- Step-by-Step Calculation Guide

What is the Interquartile Range?

The interquartile range (IQR) tells you the spread of your middle 50% of data. It's the distance between the 25th percentile (Q1) and the 75th percentile (Q3). Simple as that.

Unlike range, IQR ignores outliers and extreme values. If your dataset has a few wild numbers, IQR still gives you an honest picture of where most of your data actually sits. That's why analysts use it constantly for real-world data.

Formula: IQR = Q3 - Q1

Key Terms You Need to Know

Step-by-Step Calculation

Here's how to calculate IQR in five steps:

  1. Sort your data from smallest to largest
  2. Find the median (Q2) — this is the middle value
  3. Split data into lower and upper halves — if you have an odd number of values, exclude the median from both halves
  4. Find Q1 — median of the lower half
  5. Find Q3 — median of the upper half
  6. Calculate IQR — subtract Q1 from Q3

Example Calculation

Dataset: 4, 7, 2, 9, 12, 5, 8, 14

Step 1: Sort the data: 2, 4, 5, 7, 8, 9, 12, 14

Step 2: Find the median. With 8 values, take the average of the 4th and 5th values: (7 + 8) / 2 = 7.5

Step 3: Split the data. Lower half: 2, 4, 5, 7. Upper half: 8, 9, 12, 14

Step 4: Q1 is the median of the lower half: (4 + 5) / 2 = 4.5

Step 5: Q3 is the median of the upper half: (9 + 12) / 2 = 10.5

Step 6: IQR = 10.5 - 4.5 = 6

The middle 50% of your data spans 6 units. That's your IQR.

What If You Have an Odd Number of Values?

Say your dataset is: 3, 5, 8, 12, 15, 18, 20

The median (Q2) is 12. Exclude it. Lower half: 3, 5, 8. Upper half: 15, 18, 20.

Q1 = median of 3, 5, 8 = 5

Q3 = median of 15, 18, 20 = 18

IQR = 18 - 5 = 13

Finding Outliers with IQR

The IQR method is the standard way to detect outliers. Use this rule:

Any value outside these bounds is a potential outlier.

Using our earlier example: Q1 = 4.5, Q3 = 10.5, IQR = 6

Values below -4.5 or above 19.5 are outliers. In our dataset (2, 4, 5, 7, 8, 9, 12, 14), nothing qualifies. That's what you want to see.

IQR vs Other Spread Measures

Here's how IQR stacks up against the alternatives:

Measure What It Does Resistant to Outliers? Best Use Case
IQR Spread of middle 50% Yes Real-world data with extremes
Range Max minus Min No Quick estimate, small datasets
Variance Average squared deviation No Statistical inference, probability
Standard Deviation Square root of variance No Normal distributions, quality control

IQR wins when your data is messy. Range, variance, and standard deviation all get wrecked by a single extreme value.

Common Mistakes to Avoid

When to Use IQR

IQR is the right choice when:

Skip IQR when your data is normally distributed and well-behaved. In those cases, standard deviation gives you more information about the shape of your distribution.

Quick Reference: IQR Formula Card

Bookmark this. You'll use it every time you need to check data for outliers or describe spread without getting fooled by extreme values.