When a data set arrives pre-counted into classes, you calculate the mean by multiplying each class midpoint by its frequency, summing those products, and dividing by the total frequency; you then calculate the standard deviation from the same midpoint-weighted sum of squares. This grouped-data method returns an estimate, not the exact value, because collapsing raw observations into class intervals discards the within-class detail. Treat the result as exact only when each interval holds a single repeated value.

That boundary decides everything downstream. A grouped frequency table gives you midpoints and counts; a discrete frequency table gives you actual values and counts. Both use the same arithmetic skeleton, but only the discrete version is exact. Sherri Rose and colleagues, in a widely used biostatistics text, note that grouped estimates differ from raw-data values by an amount driven by interval width — a narrow class recovers most of the lost precision, a wide one throws it away.

Here is the working formula set before any numbers appear. For a frequency table with k classes, frequency fᵢ and midpoint xᵢ: mean equals Σ(fᵢxᵢ) ÷ Σfᵢ; population variance equals Σ(fᵢxᵢ²) ÷ Σfᵢ minus the squared mean; population standard deviation is the square root of that variance; sample standard deviation divides by (Σfᵢ − 1) instead of Σfᵢ. Each step is audited below with a 40-observation table so you can follow the arithmetic line by line.

What a Frequency Table's Mean Actually Represents

The mean of a frequency table is a weighted average in which each class stands in for every observation inside it. If the 70–79 age band holds 18 people, the formula treats all 18 as sitting exactly at 74.5, the midpoint. That substitution is the whole reason grouped results are estimates.

Three terms get confused here. The class midpoint is the average of the lower and upper class boundaries, not the stated limits in the table header. The stated limits 70–79 usually mean a true interval of 69.5 to 79.5 when data are recorded to whole numbers, because a recorded 79 could be anything up to 79.4999. Midpoint honesty matters: using 74.5 from limits and 74.5 from boundaries coincide only when limits differ by one consistent unit.

A frequency table's mean is therefore a location estimate for the underlying raw data, reported with the sample size that produced it. Nerdy math aside, the practical rule is simple. If you still have the raw numbers, calculate from them. Use the frequency table only when the raw data is gone, summarized, or protected by privacy rules.

Watch for open-ended classes. A table with "90 and over" has no upper boundary, so no midpoint exists and the grouped formula silently breaks. Either close the class at a plausible maximum, state the imputation in your methods, or report the median instead. That failure case sits behind most bad grouped estimates in published reports.

The Grouped-Data Formula, Term by Term

Write the formula in four moving parts and each part has a job. The product column fᵢxᵢ carries the total value; the squared-midpoint column fᵢxᵢ² carries the total value squared; the mean is the first sum over n; the variance is the second sum over n, minus the mean squared.

Define n as Σfᵢ, the sum of frequencies. This is the observation count, not the class count. A table with 11 classes and n = 40 has 40 observations. Mixing those two numbers up is the most common arithmetic mistake in grouped calculations, and it inflates or deflates results by a factor tied to class count.

State whether you want population or sample. The population formula divides by n; the sample formula divides by n − 1. A national census table reporting every citizen uses n; a clinic's 40-patient audit uses n − 1. Both appearances of a divisor in the calculation must match — the variance step and any later confidence interval built on the same standard deviation.

The subtraction form, variance equals mean of squares minus square of mean, is the fast version. It gives the same answer as the deviation form, variance equals Σfᵢ(xᵢ − mean)² ÷ n, but only when the mean is carried to enough decimal places. Round the mean to one decimal before squaring and the fast form drifts low. Carry at least four significant figures, or use the deviation form where the mean is subtracted first.

Build the Midpoint Column Before Any Arithmetic

Every worked grouped calculation begins with midpoints, and the midpoint column is where tables go wrong. Average the lower and upper class boundaries, not the printed limits, unless the table explicitly states that limits are boundaries. Write the midpoint with one decimal place so later squaring stays honest.

Then multiply across two new columns. Frequency times midpoint gives the product; frequency times midpoint squared gives the squared product. Sum both columns and you have everything the formulas need.

A quick sanity check before dividing: the mean must fall inside the range of midpoints. If the table's midpoints run from 14.5 to 94.5 and your computed mean lands at 103, a product or frequency was mis-keyed. Rerun the multiplication before touching the variance. This two-minute check catches most errors, and it costs nothing.

Read the totals off the bottom row. The product sum is 1,920.0 and the squared-product sum is 104,470.00, with n = 40. Those three numbers carry the rest of the calculation, so write them down before continuing.

Computing the Mean From Σfx and n

For the table above, 1,920.0 divided by 40 gives a mean of 48.0. The mean falls inside the 30–39 and 40–49 midpoints' neighbourhood, which is exactly where nine and seven observations cluster — the sanity check passes. Note that 48.0 is the mean of the midpoints weighted by frequency, not a claim about any individual observation.

Carry the mean to more places internally than you report. Reporting 48.0 while dividing by 40.0 is fine for display, but the variance step needs the unrounded value; 1,920 ÷ 40 divides cleanly here, though many real tables will not. If the division produces a repeating decimal, store four to six significant figures and round only the final report.

Interpret the number in context. A mean of 48.0 across a 10–89 class range describes the centre of mass of the counts, which sits in the middle third of the range. Skew shows up as distance between the mean and the class where the highest frequency sits — here the mode class is 40–49, close to the mean, so the distribution is roughly symmetric at its centre.

If the mean lands outside every midpoint range, stop. Something is wrong with the product column or the frequency total, and the standard deviation will inherit the error. Rebuild both columns before proceeding.

Standard Deviation From a Frequency Table Using the Deviation Method

The deviation method is the one to teach first. Subtract the mean from every midpoint, square that difference, multiply by the class frequency, sum, and divide by n or n − 1. With the same table and mean 48.0, the deviations run −33.5, −23.5, −13.5, −3.5, 6.5, 16.5, 26.5, 36.5.

Square each deviation and weight it. The sequence becomes 1,122.25; 552.25; 182.25; 12.25; 42.25; 272.25; 702.25; 1,332.25. Multiply each square by its class frequency and sum: 2,244.50 + 2,209.00 + 1,275.75 + 110.25 + 338.00 + 1,361.25 + 2,106.75 + 2,664.50, which totals 12,310.00.

Divide by n for a population figure: 12,310 ÷ 40 equals 307.75, and the square root is 17.543 standard deviation units. That is the population standard deviation. For a sample drawn from a larger population, divide 12,310 by 39 instead, giving 315.641, and the square root becomes 17.766.

Report the unit alongside the figure. A standard deviation of 17.543 in a table of ages means roughly 17.5 years of typical spread around the mean. State which divisor you used; a methods section that does not name population versus sample is incomplete and irreproducible.

The Fast Form: Sum of Squares Minus Mean Squared

The subtraction form uses the squared-product column instead of building deviation columns. Mean of squares equals 104,470 ÷ 40, which is 2,611.75. Square of the mean is 48.0² = 2,304.00. Subtract: 2,611.75 − 2,304.00 = 307.75 — the same population variance the deviation method produced. Agreement here is a planned audit, not a coincidence.

The fast form earns its place on large tables. With 60 frequency rows and long midpoint decimals, the deviation method generates 60 temporary numbers; the subtraction method generates none. Fewer temporary numbers means fewer keyboard slips for anyone auditing a long grouped table.

The trade-off is precision. If the mean were rounded to 48 instead of kept at 48.0, the square would be 2,304 and the sum of squares 2,611.75, and the variance would come out identical only because 48.0 and 48 round the same. Had the mean been 40.6667 forced to 41 for display, the variance subtraction would shrink by roughly 27 units, or 8.8 percent of the true value. That is the precision failure case for the fast form.

Treat the subtraction form as a workflow tool and the deviation form as the audit. Both should give the same number to at least two decimal places. A mismatch bigger than rounding tells you the product or squared-product column has been keyed incorrectly, and the larger the mismatch the earlier the error sits.

Discrete Frequency Tables Need a Smaller Divisor Tweak

When the table lists single values rather than ranges, the midpoints are the values themselves and the calculation becomes exact. A survey asking people how many books they read in a month produces a discrete table: value 1 with frequency 9, value 2 with frequency 15, and so on. The same formulas apply, but n − 1 versus n changes the result by a larger proportional margin when n is small.

For a tiny discrete table with 5 total observations and values weighted, the sample divisor of 4 removes all systematic bias, while the population divisor of 5 returns a standard deviation too small. For a census covering everyone, the reverse holds and n is correct. Books-read data from a community audit is a sample of a sample; the divisor choice should match how the data were collected, not how the table looks.

Some statistics courses name the sample standard deviation with a slightly different convention when the data arrive pre-grouped. If you are writing an exam answer, follow the divisor your course teaches. If you are reporting analysis, state the divisor in the methods line. This piece of course-specific variation trips up more students than the arithmetic does.

The same arithmetic with midpoints at integer values — meaning class width one — can still come out non-integer if the mean is not integer. That is fine. Grouping costs no precision when each interval holds a single repeated value, which is exactly the case for discrete tables.

Reading Standard Deviation as Spread, Not Error

Standard deviation on a grouped table measures spread of the midpoints weighted by frequency, and it is an estimate of the raw-data spread, not a statistically certified interval. An age table with mean 48.0 and standard deviation 17.543 says, roughly, that a typical respondent sits 17.5 years away from 48. A second table with the same mean but a standard deviation of 6 describes a much tighter cluster.

The contrast is total variance of 307.75 against a hypothetical 36, and the difference tells you more than the means do. The calculation itself will not warn you about a bimodal distribution or an outlier-driven tail. Those problems are lost in grouping unless the frequency column itself shows the shape.

Standard error is a separate quantity. It divides the standard deviation by the square root of n; with 17.543 and 40, the standard error is 2.77. That is the denominator for confidence limbs about the mean, so stopping at the standard deviation leaves a report incomplete. Here, the sample standard error uses 17.766 ÷ 6.325, giving 2.809.

For reporting purposes, present three numbers together: mean, standard deviation, and n. A standard deviation without n cannot be checked, and a mean without the standard deviation hides whether the data is 6 units wide or 60. That trio is the minimum publishable statement.

A Second Worked Table You Can Verify by Hand

A small table with three classes and twelve observations is the audit table. Classes 0–9 with frequency 3, 10–19 with frequency 6, and 20–29 with frequency 3; midpoints 4.5, 14.5, 24.5. Products run 13.5, 87.0, and 73.5, summing to 174.0. Divide by 12 and the mean is 14.5.

The midpoints for the grouped calculation sit at 4.5, 14.5, and 24.5, so deviations are −10.0, 0.0, and 10.0. Weighted squares become 300.00, 0.00, and 300.00, summing to 600.00. Divide by 12 for population variance, 50.00, with standard deviation 7.071.

Run the same table as a sample. Divide 600.00 by 11 and get 54.545; the square root is 7.386. The gap between the two divisors is 0.315, or 4.3 percent, and it is only that small because n = 12 is already reasonably large. A two-observation table would show a gap of around 70 percent between the two conventions.

The table of class numbers from the US Census Bureau's Current Population Survey reports age bands at five-year intervals, and anyone working from published band counts faces exactly this grouping problem. Publications of that type report grouped counts, which makes the midpoint method the standard approach for recovering a summary statistic from the data source is say a local authority's own printed table.

Because of that structure, a computable comparison row is possible. For this 600-total table, the standard error moves from 2.041 (population divisor) to 2.133 (sample divisor), and any confidence interval built without the sample convention will be slightly too tight. That is one concrete consequence of a divisor that most quick guides skip.

Rebuild it in a spreadsheet in seven clicks

If the standard deviation comes out as a formula error, check whether the squared product cell was typed as =C2D2^2 or =C2(D2^2); both work, but a missing parenthesis after * squares only the midpoint, not the frequency. Then take the square root of the variance cell, and the full pipeline sits in one row of formulas.

A spreadsheet failure to expect: the sum of squared products can produce a variance slightly larger than it should if the mean is computed from the rounded cell rather than the full precision. Use referencing rather than retyping when the mean sits in a spreadsheet cell, so no digits drop away.

The rebuild takes about five minutes and gives an exact replica of the audit above. Save the sheet as a template with boundary columns blank; the next table only needs three columns pasted in, and the formulas refresh automatically.

FAQ

What's the difference between grouped and ungrouped frequency tables?

A grouped table reports counts per class interval, while an ungrouped table reports counts per exact value. A grouped table returns an estimated mean and standard deviation; an ungrouped one returns exact figures, and that exactness costs nothing in arithmetic effort — the same midpoint formula reduces to the identity line.

Can I calculate this from a histogram instead of a table?

Yes. A histogram is a grouped frequency table drawn as bars, and the bar heights are frequencies. Read the class width from the axis scale, take each midpoint from the bar centre, and the formulas behave identically. The pivot check to note: a histogram with unequal bin widths needs the midpoint of each unequal bin, not the nominal width, prior to multiplication.

What if the top class is open-ended — "90 and over"?

No midpoint exists for an open-ended class, so the grouped formulas break unless you impute a ceiling. Options: close the class at a plausible maximum from domain context, report the median or mode instead, run a sensitivity analysis using a range of plausible ceilings, or treat an open-ended class that holds fewer than 5 percent of observations with a documented rule. Never silently assign a midpoint; publish the assumption.

Should I divide by n or n − 1 for a table with 40 observations?

Use n − 1 when the 40 observations are a sample from a larger population; use n when you have the entire population. The standard deviation in the audit runs between 17.543 and 17.766 for the two choices, and that gap is real even at n = 40. State the choice in the report.

Why does my deviation method and subtraction method give slightly different answers?

Rounding of the mean causes the drift. The subtraction form squares the rounded mean, so variance shrinks by a term proportional to the rounding error. Carry the mean to several decimal places in the subtraction form, or use the deviation method where subtraction comes before squaring and the rounding costs nothing.

Is the sample standard deviation smaller or larger than the population version?

Larger. Dividing the same sum of squared deviations by n − 1 rather than n produces a bigger quotient. For the 40-observation table the population figure is 17.543 and the sample figure is 17.766 — the sample convention deliberately inflates the estimate to remove bias.

Does grouping inflate the standard deviation estimate?

Usually the grouped estimate runs slightly low. Collapsing observations to their class midpoint discards spread inside the class, so a table with a wide class width reports a standard deviation smaller than the raw-data value. Narrow the class width and the gap shrinks; class width one removes it entirely.

Can I compute this from class limits that overlap?

No. Overlapping classes double-count observations sitting on the boundary, which means every product contribution is inflated. Resolve the boundaries first — state whether 70–79 means 69.5–79.5 or another convention — and rebuild the table. A methods note declaring the boundary convention is the fix that prevents the whole error class.