Mean and median from a frequency table
When the same value repeats over and over in a data set — exam marks across a whole class, the number of siblings each student has — writing out every single observation is tedious and error-prone. A frequency table fixes this: it lists each distinct value once, together with how many times it occurs, and turns a long messy list into a short, organised summary. This article picks up right where raw-data mean and median left off. You already know the mean as "sum over count" and the median as "the middle value of ordered data" for a plain list of numbers; here you learn to compute both of these directly from a frequency table, using a weighted-sum shortcut for the mean and a running cumulative-frequency count for the median — without ever writing out every repeated value by hand.
A frequency table lets you compute the mean by weighting each value by how often it occurs () and the median by tracking a cumulative-frequency count to locate the middle position of the full ordered list.
The core idea
A frequency table lists each distinct value found in a data set together with its frequency — the number of times occurs. If there are distinct values in the table, the total number of observations is the sum of all the frequencies:
where: is the total count of raw observations (even though only rows are written down), and each tells you how many times its own would have appeared in the original, un-summarised list.
Mean from a frequency table. Rather than adding a repeated value to itself times, multiply the value by its frequency once and add up those products:
where: is a shortcut for " added to itself times," so the numerator is exactly the sum of every raw observation and the denominator is exactly the total count — this is the same mean formula you already know, just computed efficiently.
Median from a frequency table. The median is still "the middle value of the ordered list," but a frequency table lets you locate that middle position without writing every value out. Build a cumulative frequency column — a running total of the frequencies, read top to bottom with values already in ascending order. Then: For odd , the median sits at position in the ordered list: find the first row whose cumulative frequency reaches or passes this position, and its is the median. For even , find the values at positions and the same way, and average them (they may be the same value or two different ones).
The goal is to show, with nothing beyond expanding a sum, that computing from a frequency table gives exactly the same number as adding up every individual raw observation and dividing by how many there are — so the frequency-table shortcut is not an approximation but an identical restatement of the ordinary mean.
Step 1. Write the raw-data mean as it is originally defined: add every single observation and divide by the total count . If the value occurs times, occurs times, and so on up to occurring times, the full raw sum is .
Step 2. Collapse each repeated block. Adding to itself times is, by the definition of multiplication, the same as computing once. Doing this for every block turns the long raw sum into — a much shorter sum with exactly one term per distinct value.
Step 3. Count the total number of raw observations the same way: the count is , since every occurrence of every value is counted once in its own frequency.
Step 4. Divide the collapsed sum by the collapsed count. The raw-data mean, , therefore equals term for term — no information was lost in collapsing repeats into frequencies, so the two computations must agree exactly.
Worked example
Question. A survey of 20 families records the number of children in each family in this frequency table:
| Number of children () | 0 | 1 | 2 | 3 | 4 |
|---|---|---|---|---|---|
| Number of families () | 2 | 6 | 7 | 4 | 1 |
Find the mean and the median number of children.
Step 1. Check the total frequency. , matching the 20 families surveyed — this confirms no row was missed before computing anything.
Step 2. Compute for each row and sum them for the mean: , , , , , giving . Dividing by the total frequency,
So the average family in this survey has 1.8 children — a non-whole summary value, even though no single family actually has 1.8 children.
Step 3. For the median, is even, so the middle positions are and . Build the cumulative frequency column: against .
Step 4. Locate positions 10 and 11. Cumulative frequency reaches 8 at and reaches 15 at , so observations 9 through 15 in the ordered list are all equal to 2. Both position 10 and position 11 fall in this range, so both middle values equal 2, and
Answer. The mean is 1.8 children and the median is 2 children. The two are close, which suggests this data set has no strong outlier pulling the mean away from the middle.
Common traps
- Multiplying frequencies together instead of . The mean formula needs each value multiplied by its own frequency, then summed — not frequencies multiplied by each other.
- Dividing by the number of distinct values () instead of the total frequency (). In the worked example there are only 5 rows, but the mean's divisor must be 20 (total families), not 5.
- Finding the median's middle position by counting table rows instead of cumulative frequency. The middle position must be located among the total observations, not among the distinct values.
- Stopping one row too early when reading cumulative frequency. The median value is the first whose cumulative frequency reaches or passes the required position — picking the row just before it gives the wrong answer.
Ask the tutor: If your cumulative frequency column isn't landing on the position you expect, walk the AI tutor through your table row by row to find where the count goes wrong.
Why does multiplying each value by its frequency give the same mean as adding every repeated value?
Because is exactly a shortcut for adding to itself times. If a family size of 2 occurs 7 times, adding gives the same 14 as computing once. Doing this for every row and summing gives the same total as writing out and adding every single raw observation — the frequency table just lets you skip the repetition.
Why do I need cumulative frequency instead of just picking the middle row of the table?
The middle row of the table is not the same as the middle observation. A table row can represent many repeated observations, so the actual middle of the full ordered list can land inside a row that isn't anywhere near the table's midpoint. Cumulative frequency tracks the running count of real observations as you go down the table, so it tells you exactly which row contains observation number 10, or 11, or whatever position you need.
What if the cumulative frequency lands exactly on the boundary between two rows?
That is fine and handled the same way. Suppose cumulative frequency reaches exactly 10 at one row and the wanted position is 10 — that row's value is the answer, since the 10th observation is the last one counted at that row. If you need two positions for an even (say positions 10 and 11) and they fall in different rows, average the two corresponding values, even if those values are different.