Grouped Data Mean Calculator

StatisticsLast updated: August 22, 2026

If you do not have the raw observations but only a frequency table ("5 people aged 20-30, 12 people aged 30-40"), you cannot simply add the values up and divide. In that situation each class is represented by its midpoint, and the mean is computed as a weighted mean in the form Σf·m / Σf.

This calculator reads each line as "lower-upper: frequency", shows the worksheet with the midpoint, f·m, and f·m² columns explicitly, and computes the variance, standard deviation, median-class interpolation, the Czuber mode estimate, and the quartiles alongside the grouped mean. Because every step is visible, checking a homework or exam solution is straightforward.

Write one class per line: lower bound - upper bound : frequency. A decimal comma is also accepted (10,5-20,5: 4).
Sets the denominator of the variance and the standard deviation.

Grouped Data Formulas

Class midpoint:        mᵢ = (lower boundᵢ + upper boundᵢ) / 2
Grouped mean:          x̄ = Σfᵢ·mᵢ / Σfᵢ = Σfᵢ·mᵢ / N
Variance (sample):     s² = [Σfᵢ·mᵢ² − (Σfᵢ·mᵢ)² / N] / (N − 1)
Variance (population): σ² = [Σfᵢ·mᵢ² − (Σfᵢ·mᵢ)² / N] / N
Standard deviation:    s = √s²
Median:                Md = L + [(N/2 − F) / f]·h
Quartiles:             Qₖ = L + [(k·N/4 − F) / f]·h
Mode (Czuber):         Mo = L + [d₁ / (d₁ + d₂)]·h,  d₁ = f − f₋₁,  d₂ = f − f₊₁

L is the lower bound of the class concerned, F the cumulative frequency before that class, f the frequency of the class, and h the class width. The formulas assume that the observations are spread evenly within each class.

How to Calculate

  1. Write one class per line: lower bound - upper bound : frequency (example: 20-30: 5).
  2. You do not need to sort the classes; the calculator orders them for you.
  3. Choose whether the data is a sample or the entire population — this sets the denominator of the variance (N−1 or N).
  4. Check the midpoint, f·m, and f·m² columns in the worksheet; you can write your homework solution straight from those columns.
  5. Look at which class was used in the median and mode rows; the interpolation step shows the formula with the values substituted in.
  6. Compare the mean with the median to judge whether the distribution is skewed.

Worked Examples

Mean and standard deviation from an age distribution

For 50 people spread across five age classes, the midpoints are 25, 35, 45, 55, and 65. Since Σf·m = 2,240 and Σf·m² = 106,850, the grouped mean is 2,240 / 50 = 44.80. The sample variance is (106,850 − 100,352) / 49 = 132.61 and the standard deviation is 11.52. The median class is the 40–50 range, interpolation gives a median of 44.44, and the Czuber mode is 44.

Grouped mean (x̄): 44.80 · Total frequency (N): 50 · Number of classes: 5

Exam scores (as a population)

Because the entire population was measured, the population formula is selected: with Σf·m = 2,780 the mean is 55.60, the population variance is (175,400 − 154,568) / 50 = 416.64, and the population standard deviation is 20.41. The median class is the 40–60 range and the median is 58.67; since the mean is smaller than the median, the distribution is left-skewed. The modal class is 60–80 and the Czuber estimate is 64.76.

Grouped mean (x̄): 55.60 · Total frequency (N): 50 · Number of classes: 5

Monthly income classes (thousand TL)

In the income distribution of 92 households, Σf·m = 2,690, so the mean income is 29.24 thousand TL and the standard deviation is 12.42 thousand TL. The median class is the 20–30 range and the median is 26.86; the mean exceeding the median reflects the typically right-skewed shape of income distributions. With a coefficient of variation of 42.5%, the relative variability is high.

Grouped mean (x̄): 29.24 · Total frequency (N): 92 · Number of classes: 6

Frequently Asked Questions

Why does the grouped mean differ from the raw-data mean?
The grouped calculation assumes that all the observations in a class sit at its midpoint. In reality the observations are not spread evenly within the class, so a small approximation error appears. The error shrinks as the class width shrinks; if you have the raw data, computing from it directly is always more accurate.
If the class bounds overlap (10-20, 20-30), which class does the value 20 fall into?
The common convention is that a class is half-open, [lower, upper): the value 20 falls into the 20-30 class. Because you enter the frequencies yourself, this calculator does not recount them; it is enough to stay consistent with whichever rule you used when building the table. For continuous data you can also use true class boundaries such as 9.5-19.5.
What do L, F, f, and h stand for in the median formula?
L is the lower bound of the median class, F the cumulative frequency before the median class, f the frequency of the median class itself, and h the class width. The formula uses proportion to find how far into the median class you must go to reach N/2. The same logic applies to the quartiles with N/4 for Q1 and 3N/4 for Q3.
Why is the Czuber formula used for the mode?
In a grouped table a single modal value cannot be read off directly; only the class containing the mode is known. The Czuber formula estimates a position inside that class by looking at how dominant the modal class is over its neighbors. When the neighboring frequencies are equal, the mode falls at the class midpoint; this is an estimate, not an observed value.
Do the classes have to be of equal width?
Not for the mean and the variance; those calculations work correctly with unequal widths too. In a histogram, however, the bar height should show frequency density (f/h) rather than frequency, otherwise wide classes deceive the eye. The median and mode formulas also use the width of their own class; this calculator takes each class's own width.
How do I get the same result in Excel or SPSS?
In Excel, write the midpoints in a column and use =SUMPRODUCT(f,m)/SUM(f) for the mean and =SUMPRODUCT(f,m^2) for Σf·m². In SPSS, define the class midpoint as the variable and the frequency as a weight (Data > Weight Cases) and run Descriptives for the same result. The values from this calculator match both exactly.
What should I do with an open-ended class ("70 and above")?
Because the midpoint of an open-ended class is undefined, the mean cannot be computed directly. The usual solution is to close the class by assuming the width of the neighboring classes (70-80, for example). This is an assumption and it affects the mean, so you must state in your report which upper bound you assumed. Alternatively, report measures such as the median that are unaffected by the open-ended class.