Mean of Grouped Data Calculator – Step-by-Step with Variance & Std Dev
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.
🎯 Grouped Data Knowledge Quiz
Question 1: A grouped data set has the class [20; 30) with frequency 8. The class midpoint is:
Correct answer: C. 25
The class midpoint is the centre of the class: xᵢ = (aᵢ + aᵢ₊₁) / 2.
Here: x = (20 + 30) / 2 = 25.
⚠️ Common trap: 10 is the class width (30 − 20), not the midpoint, and the frequency 8 plays no part in this formula.
Question 2: What does the mean of grouped data represent?
Correct answer: A
Once data are grouped we no longer know the individual values, only how many fall in each class. The mean is computed from the class midpoints, so it is only an estimate of the mean of the raw data.
⚠️ Do not confuse: the value with the highest frequency relates to the mode, and the middle value after sorting is the median.
Question 3: A data set has 3 classes with midpoints 10, 20, 30 and frequencies 2, 5, 3. The mean x̄ is:
Correct answer: A. 21
Sample size: n = 2 + 5 + 3 = 10.
Σmᵢxᵢ = 20 + 100 + 90 = 210
x̄ = 210 / 10 = 21
⚠️ Common trap: averaging the three midpoints (10 + 20 + 30) / 3 = 20 and forgetting to weight them by frequency.
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.
📚 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:
📐 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:
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:
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:
| Measure | Symbol | Meaning |
|---|---|---|
| Sample size | n = Σmᵢ | Total number of values |
| Mean | x̄ = Σmᵢxᵢ / n | The (estimated) centre of the data |
| Variance | s² = Σmᵢxᵢ² / n − x̄² | Mean squared deviation from x̄, in squared units |
| Standard deviation | s = √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
- Find the sample size n = m₁ + m₂ + … + mₖ.
- Find the midpoint xᵢ = (aᵢ + aᵢ₊₁) / 2 of each class.
- Build a table with columns for the class, frequency mᵢ, midpoint xᵢ, product mᵢxᵢ and a totals row.
- Compute the mean x̄ = Σmᵢxᵢ / n.
- 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) | 5 | 152.5 | 762.5 |
| [155; 160) | 12 | 157.5 | 1890 |
| [160; 165) | 18 | 162.5 | 2925 |
| [165; 170) | 10 | 167.5 | 1675 |
| [170; 175) | 5 | 172.5 | 862.5 |
| Total | n = 50 | 8115 |
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.
| Class | mᵢ | xᵢ | mᵢxᵢ | mᵢxᵢ² |
|---|---|---|---|---|
| [10; 20) | 8 | 15 | 120 | 1800 |
| [20; 30) | 15 | 25 | 375 | 9375 |
| [30; 40) | 22 | 35 | 770 | 26950 |
| [40; 50) | 12 | 45 | 540 | 24300 |
| [50; 60) | 3 | 55 | 165 | 9075 |
| Total | 60 | 1970 | 71500 |
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.
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.
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
- Using a bound instead of the midpoint: taking aᵢ or aᵢ₊₁ as the representative value instead of their average.
- Forgetting the frequencies: averaging the midpoints without weighting them by mᵢ.
- Dividing by the number of classes k instead of n: the denominator of x̄ is the total frequency, not the number of rows.
- Rounding x̄ too early and then using it to compute x̄², which distorts the variance.
- Mixing up σx and sx on the calculator.
- 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.