Math Education

5 min read

Median Formula (Ungrouped & Grouped Data): How to Calculate

Published: 11.07.2026·Updated: 11.07.2026
Dewi Lestari

Dewi Lestari

Mathematics Specialist

Median Formula (Ungrouped & Grouped Data): How to Calculate

The median is the middle value of a data set that has been ordered from smallest to largest. For an odd number of values, the median is exactly the middle value; for an even number, the median is the average of the two middle values. The median is a measure of central tendency (alongside the mean and mode) taught in middle and high school. This short guide is for students and parents.

How to Calculate the Median + Examples

Median of Ungrouped Data

The position of the median for n ordered values:

Example (odd count): Data 5, 3, 8, 7, 6. Order it first: 3, 5, 6, 7, 8. Since n = 5, the median is at position (5 + 1) / 2 = 3, which is 6.

Example (even count): Data 4, 8, 6, 10. Ordered: 4, 6, 8, 10. Since n = 4, the median = average of the 2nd and 3rd values = (6 + 8) / 2 = 7.

Median of Grouped Data

For grouped data (a frequency table), use:

Where: L = lower boundary of the median class, n = total number of data, F = cumulative frequency before the median class, f = frequency of the median class, c = class width.

Why the Median Matters

The median is not affected by extreme values (outliers), so it represents skewed data better than the mean. With incomes or widely varying test scores, the median gives a fairer "middle" value. Also learn how to calculate the mean and the mode to complete your grasp of basic statistics.

Other Math Topics

Want your child to learn maths with an experienced mentor? Try a free Master Class at Algonova — a 60-minute session for a level assessment, at no cost.