CalculatorForEver
MATH / GUIDE

How do I find the median when a list has an even number of values?

Calculator ForEver 3 min read

Sort the values numerically, locate the two center positions, then average the values in those positions. The median need not be one of the observed values.

Count positions after sorting

For an even count n, use positions n/2 and n/2 + 1 with the smallest value in position one. Do not take the two middle values from the unsorted input order. Their positions, rather than their visual location in a pasted row, define the center.

Worked example

The list 12, 3, 8, 5 sorts to 3, 5, 8, 12. With four observations, the center positions are two and three. Their values are five and eight, so the median is (5 + 8)/2 = 6.5. Reversing the original list would not change that result.

Keep duplicate observations in the count

Removing repeated values changes the dataset and can move the center positions. Include each valid observation once for every occurrence. Calculator ForEver sorts numbers numerically; blank separators do not become observations, while an actual entered zero does.

Find positions in the sorted list before averaging

For an even number n of observations, the median lies halfway between positions n/2 and n/2 + 1 after sorting. The positions are counts, while the values occupying them are the numbers to average. A list of eight values uses positions four and five; it does not use observations whose numerical values happen to be four and five. Sorting preserves repeated observations and changes only their order. Keep an indexed sorted list when checking a median so that the central positions can be identified without guessing from the original arrangement.

Work an unsorted example with separated middle values

Take the observations 18, 4, 11, 7, 23 and 10. Sorting gives 4, 7, 10, 11, 18, 23. There are six observations, so the middle positions are three and four, containing 10 and 11. Their average is 10.5. The median need not be one of the observed values. It is still expressed in the same unit as the data. Averaging the first and last observations in the unsorted list or averaging the minimum and maximum would answer a different question.

Use a midpoint calculation that handles signs

If the two middle values are −7 and −3, their average is (−7 + −3)/2 = −5. If they are −2 and 6, the median is 2. These cases show why retaining the signs matters. The midpoint is halfway along the numerical scale, not halfway between absolute magnitudes. Calculator ForEver sorts numeric values rather than text labels, so entries such as 2, 10 and 11 are ordered by value. Check the entered list if a manually sorted spreadsheet appears to use alphabetical rather than numeric order.

Keep grouping and rounding out of the position count

A frequency table can represent the same list, but each frequency must contribute its full number of observations when locating the middle positions. Rounding values before sorting can create ties or change the middle average, so use the original observations where their precision is meaningful. If the data arrive as ranges rather than exact values, a grouped-data median requires additional assumptions and is not the same as the exact-list calculation. Calculator ForEver’s median tool expects the individual numeric observations supplied in its input field.

Questions about this calculation

Can the median have a decimal when all inputs are integers?

Yes. Averaging the two center integers can produce a fractional result, such as 6.5 in this example.

Try these values in the calculator

Find the middle of an ordered set of numbers.

Use the median calculator

References

More median questions

Related tools