Free calculator

Grouped Data Calculator

Find the mean, median, mode, quartiles and standard deviation from a frequency table, with the formulas and every step written out, just like in class.

  • Step-by-step working
  • Mean · median · mode · SD
  • Handles class limits
  • Free

Frequency table

One class per line, e.g. 10-20: 4 or 10–19, 4. Gaps like 10–19, 20–29 are handled with class boundaries. An optional first line can name the columns.

Options

Result (estimates from grouped data)

Draw this table as a histogram →

Working table

Classmff·mcff(m − x̄)²
200–30025061,5006294,183.6735
300–400350144,90020206,428.5714
400–500450229,9004210,102.0408
500–600550189,90060111,122.449
600–70065074,55067223,214.2857
700–80075032,25070232,806.1224
Total7033,0001,077,857.1429

m = class midpoint, f = frequency, cf = cumulative frequency. The highlighted row is the median class.

Step-by-step solutionShow
  1. 1

    Mean: multiply each midpoint by its frequency, add, and divide by n

    x̄ = Σf·m ÷ n = 33,000 ÷ 70

    = 471.428571

  2. 2

    Median: find the class containing the (n/2)th value

    n ÷ 2 = 35. The cumulative frequency first reaches this in the class 400–500, so L = 400, CF (before) = 20, f = 22, w = 100.

    median = L + ((n/2 − CF) ÷ f) × w = 400 + ((35 − 20) ÷ 22) × 100

    = 468.181818

  3. 3

    Mode: use the modal class (the one with the highest frequency)

    Modal class 400–500: L = 400, f₁ = 22, f₀ (class before) = 14, f₂ (class after) = 18, w = 100.

    mode = L + ((f₁ − f₀) ÷ (2f₁ − f₀ − f₂)) × w = 400 + ((22 − 14) ÷ (44 − 14 − 18)) × 100

    = 466.666667

  4. 4

    Variance and standard deviation (sample)

    s² = Σf(m − x̄)² ÷ (n − 1) = 1,077,857.142857 ÷ 69 = 15,621.118012

    s = √15,621.118012 = 124.984471

These are estimates: grouping assumes values are spread evenly within each class. With the raw data, use the descriptive statistics calculator for exact values.

Grouped data formulas

StatisticFormula
Meanx̄ = Σf·m ÷ n
MedianL + ((n/2 − CF) ÷ f) × w
ModeL + ((f₁ − f₀) ÷ (2f₁ − f₀ − f₂)) × w
Variance (sample)s² = Σf(m − x̄)² ÷ (n − 1)
QuartilesLike the median, with n/4 (Q1) and 3n/4 (Q3)

m = class midpoint, f = frequency, n = total frequency, L = lower class boundary, CF = cumulative frequency before the class, w = class width.

Worked example: weekly wages

Wages of 70 workers: 200–300: 6, 300–400: 14, 400–500: 22, 500–600: 18, 600–700: 7, 700–800: 3.

  • Mean: Σf·m = 6(250) + 14(350) + 22(450) + 18(550) + 7(650) + 3(750) = 33,000, and 33,000 ÷ 70 ≈ 471.43.
  • Median: n/2 = 35. Cumulative frequencies are 6, 20, 42…, so the median class is 400–500 with CF = 20 and f = 22. Median = 400 + ((35 − 20) ÷ 22) × 100 ≈ 468.18.
  • Mode: the modal class is 400–500 (f₁ = 22, f₀ = 14, f₂ = 18). Mode = 400 + (8 ÷ 12) × 100 ≈ 466.67.

This is the default example above, so you can check each step.

Class limits like 10–19, 20–29

When classes are written with gaps between them, the median and mode formulas need the class boundaries (9.5, 19.5, 29.5…), not the limits. The calculator converts them automatically and tells you when it has. Want to see the table? Draw it with the grouped frequency histogram maker, or build a table from raw data with the frequency table maker.

Common mistakes to avoid

  • Using class limits in the median formula. L is the lower class boundary (e.g. 39.5 for 40–49), not the limit.
  • Using the wrong cumulative frequency. CF is the total of all classes before the median class, not including it.
  • Forgetting the class width. Multiply by w at the end of the median and mode formulas.
  • Treating estimates as exact. Grouped results are approximations. Say “estimated mean”.

Do it in other software

SoftwareHow
ExcelMidpoints in column C and frequencies in D: mean =SUMPRODUCT(C2:C7, D2:D7)/SUM(D2:D7).
TI-84Midpoints in L1, frequencies in L2, then 1-Var Stats L1, L2 for the mean and standard deviation.
Pythonnp.average(midpoints, weights=freqs) for the mean.

Related tools: Histogram from a Frequency Table, Frequency Distribution Table Maker, Class Width Calculator, Ogive Maker and Descriptive Statistics Calculator.

Frequently asked questions

How do you find the mean of grouped data?

Find the midpoint m of each class, multiply it by the class frequency f, add up all the f·m values, and divide by the total frequency: mean = Σf·m ÷ Σf.

What is the formula for the median of grouped data?

Median = L + ((n/2 − CF) ÷ f) × w, where L is the lower boundary of the median class, n the total frequency, CF the cumulative frequency before the median class, f the frequency of the median class and w its width.

What is the formula for the mode of grouped data?

Mode = L + ((f₁ − f₀) ÷ (2f₁ − f₀ − f₂)) × w, where L is the lower boundary of the modal class (the class with the highest frequency), f₁ its frequency, f₀ the frequency of the class before it, f₂ the frequency of the class after it and w the class width.

Why are grouped data results only estimates?

Once data is grouped, the exact values inside each class are lost. The formulas assume values are spread evenly across each class, so the results are close but not exact.

How do I calculate the standard deviation of grouped data?

Compute f·(m − mean)² for each class, add them, divide by n − 1 for a sample (or n for a population), and take the square root.

Related tools