Quartile Calculator Formula

Understand the math behind the quartile calculator. Each variable explained with a worked example.

Formulas Used

Q1 (25th Percentile)

q1 = (v1 + v2) / 2

Q2 (Median)

q2 = v3

Q3 (75th Percentile)

q3 = (v4 + v5) / 2

IQR (Q3 - Q1)

iqr = (v4 + v5) / 2 - (v1 + v2) / 2

Variables

VariableDescriptionDefault
v1Value 1 (Min)10
v2Value 220
v3Value 330
v4Value 440
v5Value 5 (Max)50

How It Works

How to Compute Quartiles

Steps (for 5 sorted values)

1. Q2 (Median): The middle value (3rd of 5) 2. Q1: Median of the lower half (values 1 and 2), so Q1 = (v1 + v2) / 2 3. Q3: Median of the upper half (values 4 and 5), so Q3 = (v4 + v5) / 2

Quartiles divide the sorted dataset into four equal parts. Q1 separates the lowest 25%, Q2 is the median, and Q3 separates the lowest 75%.

Worked Example

Find the quartiles of the sorted dataset: 10, 20, 30, 40, 50.

v1 = 10v2 = 20v3 = 30v4 = 40v5 = 50
  1. 01Q2 (Median) = v3 = 30
  2. 02Lower half: 10, 20 → Q1 = (10 + 20) / 2 = 15
  3. 03Upper half: 40, 50 → Q3 = (40 + 50) / 2 = 45
  4. 04IQR = 45 - 15 = 30

Ready to run the numbers?

Open Quartile Calculator