Mean of Grouped Data Calculator – Step-by-Step with Variance & Std Dev

Mean of Grouped Data Calculator x̄ = Σmᵢxᵢ / n

Enter a grouped frequency table with classes [a; b) and frequencies mᵢ. The calculator finds the sample size n, the class midpoints xᵢ, the mean x̄ (as a fraction and a decimal), the variance s² and the standard deviation s, with a summary table and a step-by-step solution.

📊 Enter the grouped frequency table:

No.Class [a; b)Frequency (mᵢ)Action
1
2
3
4

🎯 Grouped Data Knowledge Quiz

Question 1: A grouped data set has the class [20; 30) with frequency 8. The class midpoint is:

Question 2: What does the mean of grouped data represent?

Question 3: A data set has 3 classes with midpoints 10, 20, 30 and frequencies 2, 5, 3. The mean x̄ is:

The mean of grouped data is a core topic in high-school statistics. When data are reported as classes [aᵢ; aᵢ₊₁) with frequencies instead of individual values, every class has to be replaced by its class midpoint before any average can be computed. The calculator above does all of this for you: enter a frequency table with as many classes as you need (add, remove or delete rows), or click one of the three ready-made examples. It returns the sample size n, the midpoint of each class, the mean x̄ both as a simplified fraction and as a decimal, the variance s² and the standard deviation s (optional), together with a summary table and a step-by-step solution you can compare with your work, copy, or print on A4 paper.

Grouped frequency chart of the heights of 50 students: five classes from 150 to 175 cm with frequencies 5, 12, 18, 10, 5; purple dots are the class midpoints and the red line is the mean of 162.3 cm.5152.512157.518162.510167.55172.5150155160165170175x̄ = 162.3Height (cm)Frequency
Each bar is a class and its height is the frequency mᵢ. Purple dots mark the class midpoints xᵢ; the dashed red line is the mean x̄ = 162.3 cm, which falls in the class [160; 165).

📚 What is grouped data?

When a lot of data is collected — the heights of a whole year group, the revenue of hundreds of shops, daily phone usage — listing every value is long and hard to read. Instead, the range of values is split into consecutive classes [a₁; a₂), [a₂; a₃), …, [aₖ; aₖ₊₁) and we count how many values fall into each one. That count is the frequency mᵢ of class i, and the resulting table is a grouped frequency table.

For a class [aᵢ; aᵢ₊₁), aᵢ is the lower bound, aᵢ₊₁ is the upper bound and aᵢ₊₁ − aᵢ is the class width. Classes usually have the same width and follow on from each other: the upper bound of one class is the lower bound of the next. The last class is sometimes written as a closed interval [aₖ; aₖ₊₁] so that it includes the largest value. The calculator warns you if two neighbouring classes in your table do not join up.

The sample size is the total frequency:

n = m₁ + m₂ + … + mₖ

📐 The class midpoint

Because the individual values inside a class are unknown, the midpoint of the class is used to represent all of them. This is the best estimate when the values are assumed to be spread fairly evenly across the class:

xᵢ = (aᵢ + aᵢ₊₁) / 2

For example, the class [150; 155) has midpoint x = (150 + 155) / 2 = 152.5. When all classes have the same width h, consecutive midpoints are exactly h apart, so you only need the first midpoint and then keep adding h: 152.5, 157.5, 162.5, …

📊 Formula for the mean of grouped data

Once each class is replaced by its midpoint, the grouped data behave like a data set with m₁ values equal to x₁, m₂ values equal to x₂, and so on. The mean is therefore a weighted average:

x̄ = (m₁x₁ + m₂x₂ + … + mₖxₖ) / n

Here n is the sample size, mᵢ is the frequency and xᵢ the midpoint of class i, and k is the number of classes. The result is an estimate of the mean of the original raw data. It is used to describe the centre of the data, to compare two samples or to track a trend, not as an exact value.

📉 Variance and standard deviation of grouped data

The mean tells you where the data are centred; the variance and standard deviation tell you how spread out they are around that centre. For grouped data:

s² = (1/n)[m₁(x₁ − x̄)² + … + mₖ(xₖ − x̄)²] = (1/n)(m₁x₁² + … + mₖxₖ²) − x̄²
s = √s²
MeasureSymbolMeaning
Sample sizen = ΣmᵢTotal number of values
Meanx̄ = Σmᵢxᵢ / nThe (estimated) centre of the data
Variances² = Σmᵢxᵢ² / n − x̄²Mean squared deviation from x̄, in squared units
Standard deviations = √s²Spread in the same unit as the data; a smaller s means more uniform data

The second form, based on Σmᵢxᵢ², is usually quicker by hand because you do not subtract x̄ from every midpoint. This formula divides by n (the population form). To avoid rounding errors, the calculator keeps x̄ as an exact fraction when squaring it, so the variance is reported as a simplified fraction together with its decimal value.

🔢 Five steps to the mean of grouped data

  1. Find the sample size n = m₁ + m₂ + … + mₖ.
  2. Find the midpoint xᵢ = (aᵢ + aᵢ₊₁) / 2 of each class.
  3. Build a table with columns for the class, frequency mᵢ, midpoint xᵢ, product mᵢxᵢ and a totals row.
  4. Compute the mean x̄ = Σmᵢxᵢ / n.
  5. If required, add a column mᵢxᵢ² to get the variance s², then take the square root for the standard deviation s.

The summary table shown by the calculator is exactly the table from steps 3 and 5, ready to copy into your notebook or test.

💡 Worked examples

Example 1. Heights of a class of students

The heights (cm) of 50 students are given below. Find the mean height.

Class [a; b)Frequency mᵢMidpoint xᵢmᵢxᵢ
[150; 155)5152.5762.5
[155; 160)12157.51890
[160; 165)18162.52925
[165; 170)10167.51675
[170; 175)5172.5862.5
Totaln = 508115
x̄ = 8115 / 50 = 162.3 (cm)

The mean of 162.3 cm lies in the class [160; 165), which is also the class with the highest frequency. Going further: Σmᵢxᵢ² = 1,318,612.5, so s² = 26,372.25 − 26,341.29 = 30.96 and s ≈ 5.56 cm. This is the “Ex1” button in the calculator.

Example 2. Sales revenue (with variance and standard deviation)

Monthly revenue (millions) of 60 shops: [10; 20): 8 shops, [20; 30): 15, [30; 40): 22, [40; 50): 12, [50; 60): 3. Find the mean revenue and the standard deviation.

Classmᵢxᵢmᵢxᵢmᵢxᵢ²
[10; 20)8151201800
[20; 30)15253759375
[30; 40)223577026950
[40; 50)124554024300
[50; 60)3551659075
Total60197071500
x̄ = 197/6 ≈ 32.83; s² = 4091/36 ≈ 113.64; s ≈ 10.66

The mean revenue is about 32.83 million with a standard deviation of about 10.66 million. Note: rounding x̄ to 32.833 before squaring shifts the variance in the second decimal place, so keep the fraction 197/6 until the end.

Example 3. Daily phone usage

A survey of 90 students on daily phone use (hours): [0; 2): 10, [2; 4): 25, [4; 6): 30, [6; 8): 20, [8; 10): 5. The midpoints are 1, 3, 5, 7 and 9.

x̄ = 420 / 90 = 14/3 ≈ 4.67 (hours)

On average a student uses a phone for about 4 hours 40 minutes a day. The variance is s² = 41/9 ≈ 4.56 and the standard deviation s ≈ 2.13 hours.

Example 4. Test scores with unequal classes

Scores of 40 students: [0; 3): 2, [3; 5): 8, [5; 7): 15, [7; 9): 12, [9; 10]: 3. These classes do not have equal widths, so each midpoint must be found separately: 1.5, 4, 6, 8, 9.5.

x̄ = 249.5 / 40 = 6.2375 ≈ 6.24

The formula works just as well with unequal class widths, as long as each class uses its own midpoint.

🔁 Note: adjusting classes for discrete data

When the data are whole numbers (ages, number of children, items sold…), tables often use classes such as [40; 44], [45; 49], … To make the classes continuous they are adjusted to [39.5; 44.5), [44.5; 49.5), … by moving each bound out by 0.5. This adjustment does not change the midpoints (still 42, 47, …), so the mean and variance stay the same. You can enter the adjusted table directly into the calculator.

🎓 Checking with a Casio calculator

Casio fx-991EX / fx-570EX (ClassWiz): turn on the frequency column with SHIFT → MENU (SETUP) → Statistics → Frequency → On. Then press MENU, choose Statistics → 1-Variable, enter the midpoints in the x column and the frequencies in the Freq column, press AC and then OPTN → 1-Variable Calc. The screen shows x̄, n, Σx, Σx² and σx.

Older Casio fx-570ES / fx-991ES Plus: turn on frequency with SHIFT → MODE → ▼ → 4 (STAT) → 1 (ON); enter statistics mode with MODE → 3 (STAT) → 1 (1-VAR); enter the data, press AC and then SHIFT → 1 (STAT) → 4 (Var) to read x̄ and σx.

Important: the standard deviation s used here (dividing by n) matches σx on the calculator, not sx (which divides by n − 1). The variance is σx².

🧭 Real-world uses

  • Education: compare average results and consistency between classes when only score bands are published.
  • Business: estimate the average revenue of a chain from a report broken down by revenue band.
  • Health: track average height or weight of children by age group.
  • Manufacturing: quality control — a small standard deviation means product sizes are consistent.
  • Surveys: screen time, household income and similar questions are often asked in ranges so respondents can answer easily.

⚠️ Common mistakes

  1. Using a bound instead of the midpoint: taking aᵢ or aᵢ₊₁ as the representative value instead of their average.
  2. Forgetting the frequencies: averaging the midpoints without weighting them by mᵢ.
  3. Dividing by the number of classes k instead of n: the denominator of x̄ is the total frequency, not the number of rows.
  4. Rounding x̄ too early and then using it to compute x̄², which distorts the variance.
  5. Mixing up σx and sx on the calculator.
  6. Treating x̄ as exact: the mean of grouped data is only an estimate of the mean of the raw data.

❓ Frequently asked questions (FAQ)

Why use the class midpoint instead of the actual values?

Once data are grouped we only know how many values fall in each class, not the values themselves. The class midpoint is the best estimate for the values in a class when they are spread evenly, so the resulting mean is an estimate of the mean of the raw data.

When should I calculate the variance and standard deviation?

Whenever you need to know how spread out the data are around the mean, for example to compare the consistency of two classes or the stability of product sizes. The variance is in squared units, while the standard deviation has the same unit as the data and is easier to interpret.

How can I check that my answer is right?

The mean must lie between the smallest and largest midpoints, the sample size n must equal the sum of the frequencies, and the variance can never be negative. You can also enter the midpoints and frequencies into a Casio calculator in one-variable statistics mode and compare x̄ and σx.

How does the mean of grouped data differ from the mean of ungrouped data?

For ungrouped data, x̄ = (n₁x₁ + … + nₖxₖ) / n uses the actual values, so the result is exact. For grouped data, xᵢ is the class midpoint, so the result is only an approximation.

Can the median and mode be found for grouped data?

Yes. The median is found by interpolation inside the class that contains position n/2, and the mode by interpolation inside the class with the highest frequency. Like the mean, both are estimates.

Is the standard deviation σx or sx on a Casio calculator?

The formula used here divides by n, so the standard deviation s matches σx on a Casio calculator. The value sx divides by n − 1 (the sample-corrected version) and is slightly larger.

🔗 Related tools